|Subject:||Functions to read from a stream and read single documents|
When sequentially processing files that contain a large number of documents, the only option now is to read in all the documents at once. This could require a large amount of memory unnecessarily. It would therefore be very useful to have a function that can just read in a single document from an open stream. To make this more general, functions for reading from and writing to open streams would be useful. The function for reading from an open stream could then have a parameter that specifies the maximum number of documents to read at once.