ot::io
class DataInputStream
#include "ot/io/DataInputStream.h"
A FilterInputStream that implements the DataInput interface by reading bytes from the contained InputStream.
- Since:
-
OpenTop 1.4
| Constructor/Destructor Summary |
DataInputStream(InputStream* pInputStream)
Constructs a DataInputStream using pInputStream as the contained input stream. |
| Method Summary
|
virtual void |
readFully(Byte* pBuffer, size_t bufLen)
Reads exactly bufLen bytes from the current position in the stream. |
virtual size_t |
skipBytes(size_t n)
Positions the stream as if by calling readByte() n times. |
| Methods inherited from class ot::io::FilterInputStream |
available(), close(), getInputStream(), mark(size_t), markSupported(), read(), read(Byte*, size_t), reset(), setInputStream(InputStream*), skip(size_t) |
| Constructor/Destructor Detail |
DataInputStream
DataInputStream(InputStream* pInputStream)
-
Constructs a DataInputStream using pInputStream as the contained input stream.
- Exceptions:
NullPointerException -
if pInputStream is null.
readFully
virtual void readFully(Byte* pBuffer,
size_t bufLen)
-
Reads exactly bufLen bytes from the current position in the stream.
If EndOfFile is reached before bufLen bytes have been read an EOFException is thrown.
- Parameters:
pBuffer -
A pointer to the buffer into which the bytes will be copied. This must be capable of holding at least bufLen bytes.
bufLen -
The required number of bytes to read into the passed buffer.
- Exceptions:
EOFException -
if end of stream was reached before sufficient bytes were read.
IllegalArgumentException -
if bufLen is zero
NullPointerException -
if pBuffer is null
IOException -
if an I/O error occurs.
skipBytes
virtual size_t skipBytes(size_t n)
-
Positions the stream as if by calling readByte() n times.
- Returns:
-
The number of bytes skipped, which will be equal to n unless the end of stream was reached first.
- Exceptions:
IOException -
if an I/O error occurs.
Found a bug or missing feature? Please email us at support@elcel.com