You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,10 @@ file format.
40
40
Sometimes you want to read or write files that are larger than your available
41
41
memory, or might be an unknown or infinite length (e.g. reading an audio or
42
42
video stream from a socket). In these cases it might not make sense to process
43
-
the whole file at once, but instead process it a chunk at a time. For these situations FileIO provides the `loadstreaming` and `savestreaming` functions, which return an object that you can `read` or `write`, rather than the file data itself.
43
+
the whole file at once, but instead process it a chunk at a time. For these
44
+
situations FileIO provides the `loadstreaming` and `savestreaming` functions,
45
+
which return an object that you can `read` or `write`, rather than the file data
46
+
itself.
44
47
45
48
This would look something like:
46
49
@@ -69,7 +72,8 @@ do loadstreaming("bigfile.wav") audio
69
72
end
70
73
```
71
74
72
-
Note that in these cases you may want to use `read!` with a pre-allocated buffer for maximum efficiency.
75
+
Note that in these cases you may want to use `read!` with a pre-allocated buffer
76
+
for maximum efficiency.
73
77
74
78
## Adding new formats
75
79
@@ -173,7 +177,13 @@ automatically even if the code inside the `do` scope throws an error.)
173
177
Conversely, `load(::Stream)` and `save(::Stream)` should not close the
174
178
input stream.
175
179
176
-
`loadstreaming` and `savestreaming` use the same query mechanism, but return a decoded stream that users can `read` or `write`. You should also implement a `close` method on your reader or writer type. Just like with `load` and `save`, if the user provided a filename, your `close` method should be responsible for closing any streams you opened in order to read or write the file. If you are given a `Stream`, your `close` method should only do the clean up for your reader or writer type, not close the stream.
180
+
`loadstreaming` and `savestreaming` use the same query mechanism, but return a
181
+
decoded stream that users can `read` or `write`. You should also implement a
182
+
`close` method on your reader or writer type. Just like with `load` and `save`,
183
+
if the user provided a filename, your `close` method should be responsible for
184
+
closing any streams you opened in order to read or write the file. If you are
185
+
given a `Stream`, your `close` method should only do the clean up for your
0 commit comments