APIdia Launch Partner
Top Fields Constructors Methods
sun.rmi.log

public Class LogInputStream

extends InputStream
Class Inheritance
Imports
java.io.*

Field Summary

Modifier and TypeField and Description
private InputStream
private int

Constructor Summary

AccessConstructor and Description
public
LogInputStream(InputStream
the system dependent file descriptor
in
,
int
the total number of bytes allowed to be read
length
)

Creates a log input file with the specified system dependent file descriptor.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of available bytes, which is initially equal to the file size.
available
()

Overrides java.io.InputStream.available.

Returns the number of bytes that can be read without blocking.

public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes the input stream.

public int

Returns:

the byte read, or -1 if the end of the log or end of the stream is reached.
read
()

Implements abstract java.io.InputStream.read.

Reads a byte of data.

public int

Returns:

the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.
read
(byte[]
the buffer into which the data is read
b
)

Overrides java.io.InputStream.read.

Reads data into an array of bytes.

public int

Returns:

the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.
read
(byte[]
the buffer into which the data is read
b
,
int
the start offset of the data
off
,
int
the maximum number of bytes read
len
)

Overrides java.io.InputStream.read.

Reads data into an array of bytes.

public long

Returns:

the actual number of bytes skipped.
skip
(long
the number of bytes to be skipped
n
)

Overrides java.io.InputStream.skip.

Skips n bytes of input.

Inherited from java.io.InputStream:
markmarkSupportednullInputStreamreadAllBytesreadNBytesreadNBytesresetskipNBytestransferTo

Field Detail

inback to summary
private InputStream in
lengthback to summary
private int length

Constructor Detail

LogInputStreamback to summary
public LogInputStream(InputStream in, int length) throws IOException

Creates a log input file with the specified system dependent file descriptor.

Parameters
in:InputStream

the system dependent file descriptor

length:int

the total number of bytes allowed to be read

Exceptions
IOException:
If an I/O error has occurred.

Method Detail

availableback to summary
public int available() throws IOException

Overrides java.io.InputStream.available.

Returns the number of bytes that can be read without blocking.

Returns:int

the number of available bytes, which is initially equal to the file size.

Exceptions
IOException:

Doc from java.io.InputStream.available.

if an I/O error occurs.

closeback to summary
public void close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes the input stream. No further input can be read. the stream.

readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Reads a byte of data. This method will block if no input is available.

Returns:int

the byte read, or -1 if the end of the log or end of the stream is reached.

Exceptions
IOException:
If an I/O error has occurred.
readback to summary
public int read(byte[] b) throws IOException

Overrides java.io.InputStream.read.

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

Parameters
b:byte[]

the buffer into which the data is read

Returns:int

the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.

Exceptions
IOException:
If an I/O error has occurred.
readback to summary
public int read(byte[] b, int off, int len) throws IOException

Overrides java.io.InputStream.read.

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

Parameters
b:byte[]

the buffer into which the data is read

off:int

the start offset of the data

len:int

the maximum number of bytes read

Returns:int

the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.

Exceptions
IOException:
If an I/O error has occurred.
skipback to summary
public long skip(long n) throws IOException

Overrides java.io.InputStream.skip.

Skips n bytes of input.

Parameters
n:long

the number of bytes to be skipped

Returns:long

the actual number of bytes skipped.

Exceptions
IOException:
If an I/O error has occurred.