TInputStream
Inheritance
Level | Ancestor | Description |
---|---|---|
1 | TObject | Ultimate ancestor in a class hierarchy |
2 | TInputStream |
Source
Stream.Input.pas (30)
Description
Streams can have a definite or indefinite size but this fact is not known to the user
of the stream. To check whether the stream has reached its end one can use AtEnd
.
If False
is returned, this does not necessarily mean that there are more bytes to
read. If True
is returned one can be sure that the stream has no more bytes and reading
more would result in an exception. A call to AtEnd
will block for streams with indefinite
size until data is known to be available or the stream is known to have reached its end.
The function Available
returns the amount of bytes that are known to be still available. This
function might return zero while in fact there are still more bytes to read. Implementors of Available
are encouraged to return the largest value that can be known to be available without having to implement buffering schemes.
A call to Available
will never block.
When decoding multi-byte simple values the order of the constituting bytes can either be big endian (higher order bytes first) or
little endian (lower order bytes first). TInputStream
provides functions to read simple values using either big
or little endian encoding. These functions work correctly regardless of the endianness of the underlying platform.
Methods
Scope | Visibility | Result | Name | Description |
---|---|---|---|---|
Instance | public | TPositiveInteger32 | Available() | Returns the known amount of bytes available to read, can be zero which does not indicate the end of the stream. |
Instance | public | TBoolean | AtEnd() |
Indicates whether the stream has no more bytes to read, when False is returned this does not guarantee that there are more bytes to read.
When a stream is blocking a call to AtEnd will block as well.
|
Instance | public | Read(Buffer; Count: TPositiveInteger32) | Reads Count bytes from the stream into Buffer . | |
Instance | public | Skip(Count: TPositiveInteger64) | Skips Count bytes from the stream and discards those bytes. | |
Instance | public | TPositiveInteger8 | ReadLittleEndian8() | |
Instance | public | TPositiveInteger16 | ReadLittleEndian16() | |
Instance | public | TPositiveInteger32 | ReadLittleEndian24() | |
Instance | public | TPositiveInteger32 | ReadLittleEndian32() | |
Instance | public | TPositiveInteger64 | ReadLittleEndian64() | |
Instance | public | TFloatingPoint32 | ReadLittleEndianFloatingPoint32() | |
Instance | public | TFloatingPoint64 | ReadLittleEndianFloatingPoint64() | |
Instance | public | TPositiveInteger32 | ReadBigEndian8() | |
Instance | public | TPositiveInteger32 | ReadBigEndian16() | |
Instance | public | TPositiveInteger32 | ReadBigEndian24() | |
Instance | public | TPositiveInteger32 | ReadBigEndian32() | |
Instance | public | TPositiveInteger64 | ReadBigEndian64() | |
Instance | public | TFloatingPoint32 | ReadBigEndianFloatingPoint32() | |
Instance | public | TFloatingPoint64 | ReadBigEndianFloatingPoint64() |