Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.io   Previous This
Package
Next

 


Class OffsetInputStreamFilter

public class OffsetInputStreamFilter extends FilterInputStream
{
  // Constructors
  public OffsetInputStreamFilter (InputStream i);

  // Methods
  public long getOffset ();
  public void mark(int readlimit);
  public synchronized int read() throws IOException;
  public synchronized int read (byte b[], int off, int len)
        throws IOException;
  public void reset() throws IOException;
  public synchronized long skip (long n) throws IOException;
  public synchronized long skipToAlignment (int align)
        throws IOException;
}

This class represents a filter input stream that keeps track of the byte offset into the stream.

FilterInputStream
  |
  +--OffsetInputStreamFilter

Constructors

OffsetInputStreamFilter

public OffsetInputStreamFilter (InputStream i);

Creates an OffsetInputStreamFilter object from the specified input stream.

ParameterDescription
i The input stream.

Methods

getOffset

public long getOffset ();

Retrieves the current byte offset into the input stream.

Return Value:

Returns the current byte offset into the input stream.

mark

public void mark(int readlimit);

Marks the current position in the input stream.

Return Value:

No return value.

ParameterDescription
readlimit The number of bytes that can be read without invalidating the mark.

read

public synchronized int read() throws IOException;

Reads a single byte from the input stream.

Return Value:

Returns the byte that was read from the input stream.

Exceptions:

IOException if an error occurs while attempting to read.

read

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

Reads a sequence of bytes from the input stream into the buffer.

Return Value:

Returns the number of bytes read.

ParameterDescription
b The buffer to store the bytes in.
off The offset in the buffer where the first byte read is stored.
len The number of bytes to read.

Exceptions:

IOException if an error occurs while attempting to read.

reset

public void reset() throws IOException;

Resets the byte offset of the input stream to the last marked position.

Return Value:

No return value.

Exceptions:

IOException if the mark is invalid or has not been set.

skip

public synchronized long skip (long n) throws IOException;

Skips a number of bytes in the input stream and updates the byte offset to reflect the new position in the stream.

Return Value:

Returns the actual number of bytes skipped.

ParameterDescription
n The number of bytes to skip.

Exceptions:

IOException if an I/O error occurs.

skipToAlignment

public synchronized long skipToAlignment (int align) throws IOException;

Skips bytes in the input stream until the byte offset is a multiple of the alignment.

Return Value:

Returns the actual number of bytes skipped.

ParameterDescription
align The alignment.

Exceptions:

IOException if an I/O error occurs.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.