Available on all platforms
@:keepnew(b:Bytes, ?pos:Int, ?len:Int)
@:keepread onlylength:Int
The length of the stream in bytes.
@:keepposition:Int
The current position in the stream in bytes.
@:keepbigEndian:Bool
Endianness (word byte order) used when reading numbers.
If true, big-endian is used, otherwise little-endian is used.
true
little-endian
@:keepclose():Void
Close the input source.
Behaviour while reading after calling this method is unspecified.
@:keepread(nbytes:Int):Bytes
Read and return nbytes bytes.
nbytes
@:keepreadAll(?bufsize:Int):Bytes
Read and return all available data.
The bufsize optional argument specifies the size of chunks by which data is read. Its default value is target-specific.
bufsize
@:keepreadDouble():Float
Read a 64-bit double-precision floating point number.
Endianness is specified by the bigEndian property.
bigEndian
@:keepreadFloat():Float
Read a 32-bit floating point number.
@:keepreadFullBytes(s:Bytes, pos:Int, len:Int):Void
Read len bytes and write them into s to the position specified by pos.
len
s
pos
Unlike readBytes, this method tries to read the exact len amount of bytes.
readBytes
@:keepreadInt16():Int
Read a 16-bit signed integer.
@:keepreadInt24():Int
Read a 24-bit signed integer.
@:keepreadInt32():Int
Read a 32-bit signed integer.
@:keepreadInt8():Int
Read a 8-bit signed integer.
@:keepreadLine():String
Read a line of text separated by CR and/or LF bytes.
The CR/LF characters are not included in the resulting string.
@:keepreadString(len:Int, ?encoding:Encoding):String
Read and len bytes as a string.
@:keepreadUInt16():Int
Read a 16-bit unsigned integer.
@:keepreadUInt24():Int
Read a 24-bit unsigned integer.
@:keepreadUntil(end:Int):String
Read a string until a character code specified by end is occurred.
end
The final character is not included in the resulting string.