Microsoft SDK for Java

read

The read method of the ActiveXInputStream Class contains the following signatures:

read()
read(byte b[], int off, int len)

read()

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.

Syntax

public int read() throws IOException;

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.

read(byte b[], int off, int len)

Reads bytes of data from the input stream into an array of bytes. This method blocks until some input is available.

Syntax

public int read(byte b[], int off, int len) throws IOException;

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.

Parameters

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.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.