Input
An Input is an abstract reader. See other classes in the haxe.io package
for several possible implementations.
All functions which read data throw Eof when the end of the stream
is reached.
Instance Members
bigEndian: BoolEndianness (word byte order) used when reading numbers.
If true, big-endian is used, otherwise little-endian is used.
readByte(): IntRead and return one byte.
| Returns |
|---|
| Int |
Read len bytes and write them into s to the position specified by pos.
Returns the actual length of read data that can be smaller than len.
See readFullBytes that tries to read the exact amount of specified bytes.
| Name | Type |
|---|---|
s |
Bytes |
pos |
Int |
len |
Int |
| Returns |
|---|
| Int |
close(): VoidClose the input source.
Behaviour while reading after calling this method is unspecified.
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.
| Name | Type | Default |
|---|---|---|
bufsize |
Int | (optional) |
| Returns |
|---|
| Bytes |
Read len bytes and write them into s to the position specified by pos.
Unlike readBytes, this method tries to read the exact len amount of bytes.
| Name | Type |
|---|---|
s |
Bytes |
pos |
Int |
len |
Int |
Read and return nbytes bytes.
| Name | Type |
|---|---|
nbytes |
Int |
| Returns |
|---|
| Bytes |
Read a string until a character code specified by end is occurred.
The final character is not included in the resulting string.
| Name | Type |
|---|---|
end |
Int |
| Returns |
|---|
| String |
readFloat(): FloatRead a 32-bit floating point number.
Endianness is specified by the bigEndian property.
| Returns |
|---|
| Float |
readInt16(): IntRead a 16-bit signed integer.
Endianness is specified by the bigEndian property.
| Returns |
|---|
| Int |
readUInt16(): IntRead a 16-bit unsigned integer.
Endianness is specified by the bigEndian property.
| Returns |
|---|
| Int |
readInt24(): IntRead a 24-bit signed integer.
Endianness is specified by the bigEndian property.
| Returns |
|---|
| Int |
readInt32(): IntRead a 32-bit signed integer.
Endianness is specified by the bigEndian property.
| Returns |
|---|
| Int |
Read and len bytes as a string.
| Name | Type | Default |
|---|---|---|
len |
Int | |
encoding |
Anonymous | (optional) |
| Returns |
|---|
| String |