Class ActiveXInputStream
public class ActiveXInputStream extends InputStream
{
// Constructors
public ActiveXInputStream(IStream stream);
// Methods
public int available() throws IOException;
public void close() throws IOException;
public int read() throws IOException;
public int read(byte b[], int off, int len) throws IOException;
public long skip(long n) throws IOException;
}
This class provides access to methods that manipulate input streams. You can create an input stream, read bytes from it, skip a specified number of bytes in the stream, see how many bytes are available to read, and close an input stream using the methods in this class.
InputStream
|
+--ActiveXInputStream
public ActiveXInputStream(IStream stream);
Creates an ActiveXInputStream object.
Parameter | Description |
stream
| The IStream interface for the new object.
|
public int available() throws IOException;
Determines the number of bytes that can be read from the input stream without blocking.
Return Value:
Returns the number of bytes that can be read from the input stream without blocking.
Exceptions:
IOException
if an I/O error occurs.
public void close() throws IOException;
Closes the input stream and releases the IStream interface associated with the stream.
Return Value:
No return value.
Exceptions:
IOException
if an I/O error occurs.
public int read() throws IOException;
Reads the next byte of data from the input stream. The value of the byte is returned as an integer in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.
Return Value:
Returns the next byte of data, or -1 if the end of the stream is reached.
Exceptions:
IOException
if an I/O error occurs.
public int read(byte b[], int off, int len) throws IOException;
Reads bytes of data from the input stream into an array of bytes. This method blocks until some input is available.
Return Value:
Returns the total number of bytes read into the buffer; returns -1 if there is no more data because the end of the file has been reached.
Parameter | Description |
b
| The buffer into which the data is read.
|
off
| The starting offset of the data.
|
len
| The maximum number of bytes to read.
|
Exceptions:
IOException
if an I/O error occurs.
public long skip(long n) throws IOException;
Skips over and discards bytes of data from the input stream and returns the number of bytes actually skipped.
Return Value:
Returns the number of bytes skipped.
Parameter | Description |
n
| The number of bytes to skip.
|
Remarks:
If there are fewer than n bytes remaining before the end of the stream, this method skips the number of bytes remaining. The current read position is set to the end of the file and the number of bytes skipped is returned.
Exceptions:
IOException
if an I/O error occurs.