public class

LogInputStream

extends InputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ sun.rmi.log.LogInputStream

Summary

Public Constructors
LogInputStream(InputStream in, int length)
Creates a log input file with the specified system dependent file descriptor.
Public Methods
int available()
Returns the number of bytes that can be read without blocking.
void close()
Closes the input stream.
int read(byte[] b)
Reads data into an array of bytes.
int read()
Reads a byte of data.
int read(byte[] b, int off, int len)
Reads data into an array of bytes.
long skip(long n)
Skips n bytes of input.
Protected Methods
void finalize()
Closes the stream when garbage is collected.
[Expand]
Inherited Methods
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public LogInputStream (InputStream in, int length)

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

Parameters
length the total number of bytes allowed to be read
Throws
IOException If an I/O error has occurred.

Public Methods

public int available ()

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

Returns
  • the number of available bytes, which is initially equal to the file size.
Throws
IOException

public void close ()

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

public int read (byte[] b)

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

Parameters
b the buffer into which the data is read
Returns
  • the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.
Throws
IOException If an I/O error has occurred.

public int read ()

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

Returns
  • the byte read, or -1 if the end of the log or end of the stream is reached.
Throws
IOException If an I/O error has occurred.

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

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

Parameters
b the buffer into which the data is read
off the start offset of the data
len the maximum number of bytes read
Returns
  • the actual number of bytes read, or -1 if the end of the log or end of the stream is reached.
Throws
IOException If an I/O error has occurred.

public long skip (long n)

Skips n bytes of input.

Parameters
n the number of bytes to be skipped
Returns
  • the actual number of bytes skipped.
Throws
IOException If an I/O error has occurred.

Protected Methods

protected void finalize ()

Closes the stream when garbage is collected.

Throws
IOException