Returns length of stream.
MAKE-BINARY-ARRAY-INPUT-STREAM (&OPTIONAL INITIAL-CONTENTS)
Returns new binary array input stream. The initial-contents is sequence of bytes and if given the stream contains bytes in initial-contents.
MAKE-BINARY-ARRAY-IO-STREAM (&OPTIONAL INITIAL-CONTENTS)
Returns new binary array input/output stream. The initial-contents is sequence of bytes and if given the stream contains bytes in initial-contents.
MAKE-BINARY-ARRAY-OUTPUT-STREAM (&OPTIONAL INITIAL-CONTENTS)
Returns new binary array output stream. The initial-contents is sequence of bytes and if given the stream contains bytes in initial-contents.
OPEN-BINARY-STREAM (FILESPEC &KEY (IF-EXISTS OVERWRITE) (IF-DOES-NOT-EXIST ERROR))
Opens and returns binary stream. If filespec is a string or pathname, the designed file is opened. If filespec is stream, filespec is returned.
READ-ARRAY (STREAM SIZE &OPTIONAL (ELEMENT-READER #'READ-BYTE))
Reads and returns array of values. Each value is read with element-reader.
READ-BYTES (STREAM SIZE &OPTIONAL OFFSET)
Reads and returns size bytes from stream. If offset is given, stream is positioned to that offset before reading.
READ-INTEGER (STREAM &KEY (BYTES 1) (SIGNED NIL) (ENDIANNESS LITTLE-ENDIAN))
Reads and returns integer from stream. Integer size is (8 * bytes) bits. If signed is t integer is interpreted as signed, otherwise unsigned. Byte order is defined by endianness.
READ-INTEGERS (STREAM SIZE &KEY (BYTES 1) (SIGNED NIL) (ENDIANNESS LITTLE-ENDIAN))
Reads and returns array of integers of size bytes.
WRITE-INTEGER (VALUE STREAM &KEY (BYTES 1) (ENDIANNESS LITTLE-ENDIAN))
Writes integer to stream as unsigned bytes. Byte order is defined by endianness.
WRITE-INTEGERS (SEQ STREAM &KEY (BYTES 1) (ENDIANNESS LITTLE-ENDIAN))
Write sequence of integers to binary stream.
Returns byte array suitable for binary array stream. input-byte-seq is sequence of bytes which is converted to suitable byte array if necessary.
INT-BYTES (INT BYTES &AUX (BYTES-1 (1- BYTES)))
Returns bytes from given (positive) integer least significant byte first.
TWOS-COMPLEMENT (VALUE BYTES)
Returns two's complement of given value. Bytes is size of value in bytes.
TWOS-COMPLEMENT-SIGNED (VALUE BYTES &AUX (BITS (* BYTES 8)) (SIGN-BIT (1- BITS)))
Returns signed integer. Value is in two's complement format and result has bytes * 8 bits.
WITH-INPUT-FROM-BINARY-ARRAY ((VAR ARRAY &KEY (INDEX 0 INDEX-P) START END) &BODY BODY)
Binds var to binary array input stream with given initial contents and executes body with var available for reading.
WITH-OUTPUT-TO-BINARY-ARRAY ((STREAM &OPTIONAL ARRAY-FORM) &BODY BODY)
Returns byte array after executing the body from binary array stream.
Returns t, if obj is binary-array-stream, nil otherwise.
SETFBINARY-ARRAY-POSITION (NEW-VALUE OBJECT)
The binary array input stream for reading data from binary stream.
The binary array input/output stream for both reading and writng data from and to binary stream.
The binary array output stream for writing data to binary stream.
The base class for binary array streams. The stream is implemented with gray streams. The stream can used to store both characters and bytes. The class has adjustable array for storing stream contents.