[TIMOB-3750] Change Ti.Stream.createStream() to take a 'mode'
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-13T17:15:43.000+0000 |
Affected Version/s | Sprint 2011-17 |
Fix Version/s | Release 1.7.0, Sprint 2011-17 |
Components | iOS |
Labels | ti.stream |
Reporter | Stephen Tramer |
Assignee | Stephen Tramer |
Created | 2011-04-26T17:57:09.000+0000 |
Updated | 2011-05-13T17:15:43.000+0000 |
Description
General agreement is that the stream spec was incomplete wrt BufferStream and BlobStream. In particular, they should take a mode which specifies whether they are 'read', 'write', or 'append'. In particular:
- 'Ti.Stream.MODE_READ' should read from the current position
- 'Ti.Stream.MODE_WRITE' should write to the current position
- 'Ti.Stream.MODE_APPEND' should append to end of data
- 'Ti.Stream.createBuffer()' now takes a box object, with keys 'source' (data source) and 'mode' (mode). Both are required.
-- Data streams created from Blobs can only be MODE_READ
-- Data streams cannot have mixed modes (i.e. no MODE_READ | MODE_WRITE)
Resolved by 3e7e251.
Stream drillbit tests pass - in the basicBufferStream test, we call Ti.Stream.createStream, passing in a mode, thereby verifying this fix.