OSID Logo
OSID Specifications
transport package
Version 3.0.0
Release Candidate Preview
Interfaceosid.transport.DataInputStream
Description

The data input stream provides a means for reading data from a stream.

MethodatEndOfStream
Description

Tests if the end of this stream has been reached. This may not be a permanent condition as more data may be available at a later time as in the case of tailing a file.

Returnboolean true if the end of this stream has been reached, false otherwise
ErrorsILLEGAL_STATEthis stream has been closed
CompliancemandatoryThis method must be implemented.
Methodavailable
Description

Gets the number of bytes available for retrieval. The number returned by this method may be less than or equal to the total number of bytes in this stream.

Returncardinalthe number of bytes available for retrieval
ErrorsILLEGAL_STATEthis stream has been closed
CompliancemandatoryThis method must be implemented.
Methodskip
Description

Skips a specified number of bytes in the stream.

Parameterscardinalnthe number of bytes to skip
Returncardinalthe actual number of bytes skipped
ErrorsILLEGAL_STATEthis stream has been closed or atEndOfStream() is true
CompliancemandatoryThis method must be implemented.
Methodread
Description

Reads a specified number of bytes from this stream.

Parametersbyte[]bufthe buffer in which the data is read
cardinalnthe number of bytes to read
Returnintegerthe actual number of bytes read
ErrorsILLEGAL_STATEthis stream has been closed or atEndOfStream() is true
INVALID_ARGUMENTthe size of buf is less than n
NULL_ARGUMENT buf is null
OPERATION_FAILEDunable to complete request
CompliancemandatoryThis method must be implemented.
Methodclose
Description

Closes this stream and frees up any allocated resources. Methods in this object may not be invoked after this method is called.

ErrorsILLEGAL_STATEthis stream has been closed
CompliancemandatoryThis method must be implemented.