- (byte-blob-stream? X) => BOOL procedure
Returns #t if the given object is a stream that is either empty or its first element is a byte blob, #f otherwise.
- (byte-blob-stream-empty? STREAM) => BOOL procedure
Returns #t if the given stream is empty, #f otherwise.
- (byte-blob-stream-empty) => STREAM procedure
Returns an empty stream.
- (byte-blob-stream-cons BYTE-BLOB STREAM) => STREAM procedure
Prepends the given byte blob to the given stream and returns the resulting stream.
- (byte-blob-stream-length STREAM) => INTEGER procedure
Returns the number of elements contained in all byte blobs in the given stream.
- (byte-blob-stream-car STREAM) => X procedure
Returns the first element of the first byte blob contained in the given stream. The stream argument must be non-empty, or an exception will be thrown.
- (byte-blob-stream-cdr STREAM) => STREAM procedure
Returns a stream that contains the elements after the first element of the given byte blob. The argument stream must be non-empty, or an exception will be thrown.
- (byte-blob-stream-ref STREAM I) => BYTE procedure
Returns the i-th element of the given stream of byte blobs.
- (byte-blob-stream-append STREAM STREAM) => STREAM procedure
Appends two streams of byte blobs together.
- (byte-blob-stream-reverse STREAM) => STREAM procedure
Returns a stream that contains the elements of the given stream of byte blobs in reverse order.
- (byte-blob-stream-intersperse STREAM BYTE) => STREAM procedure
Returns a stream of byte blobs with the given byte placed between the elements of the each byte blob from the input stream, and between byte blobs.
- (byte-blob-stream-map F STREAM) => STREAM procedure
Returns a stream of byte blobs obtained by applying F to each element of the byte blobs in the input stream.
- (byte-blob-stream->list STREAM) => LIST procedure
Returns a list containing the elements of the byte blobs contained in the input stream. If procedure F is provided as a second argument, it is applied to every element of the returned list.
- (list->byte-blob-stream LIST) => STREAM procedure
Returns a stream of a single byte blob containing the elements of the given list.
- (byte-blob-stream-take STREAM N) => STREAM procedure
Returns the prefix of the given stream of byte blobs of length N.
- (byte-blob-stream-drop STREAM N) => STREAM procedure
Returns the suffix of the given stream of byte blobs after the first N elements.
- (byte-blob-stream-span STREAM START END) => STREAM procedure
Returns the subsequence of the given stream of byte blobs from position START to position END.
- (byte-blob-stream-fold-left F INIT STREAM) => VALUE procedure
- (byte-blob-stream-fold-right F INIT STREAM) => VALUE procedure
Given a procedure of two arguments, a starting value, and a stream of byte blobs, reduces the stream using the supplied procedure, from left to right, or right to left, respectively.
- (byte-blob-stream-find NEEDLE HAYSTACK) => LIST procedure
Finds all non-overlapping instances of the byte blob NEEDLE in the stream of byte blobs HAYSTACK. The first element of the returned list is the prefix of HAYSTACK prior to any matches of NEEDLE. The second is a list of lists.
The first element of each pair in the list is a span from the beginning of a match to the beginning of the next match, while the second is a span from the beginning of the match to the end of the input.
- (file->byte-blob-stream FILENAME [BLOCKSIZE] ) => STREAM procedure
Reads a file into a byte-blob stream.
- 1.5 Updated test script to return proper exit code
- 1.4 Added procedure list->byte-blob-stream
- 1.3 Added optional second argument to byte-blob-stream->list
- 1.2 Added procedure file->byte-blob-stream
- 1.0 Initial release
Based on ideas from the Haskell bytestring library.
The code for byte-blob-stream-find is based on code from the Haskell Text library by Tom Harper and Bryan O'Sullivan.
Copyright 2009-2011 Ivan Raikov and the Okinawa Institute of Science and Technology.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.