[BinaryFile]|[nil] Stream = BinaryFile.readStream(self, bytesToRead, compressionType, compressionLevel, compressionHeader, isOutputStream)


Reads a memory stream from the file

Parameters


self

BinaryFile

The instance of self

bytesToRead

integer | "nil

How many bytes to read, nil would be everything ahead (:size() - :tell())

[Optional] compressionType

string

The compression type to use, anything that isn't store or none will have compression enabled

[Optional] compressionLevel

integer

The compression level to use, 0 is terrible compression, 1 is fastest, 6 is balanced, 9 is best compression, if you get an output stream this will be its compression level.

[Optional] compressionHeader

boolean | "nil

If you want to skip the header, if you do you can't read the file without knowing the compression type

[Optional] isOutputStream

boolean | "nil

If you want to read the stream as an output stream, this will make it so you can write to the stream and it will write to it

Return Value


Stream

BinaryFile | nil

The stream that was read