Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ydp.jai
Class ForwardSeekableStream  view ForwardSeekableStream download ForwardSeekableStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.ydp.jai.SeekableStream
          extended byorg.ydp.jai.ForwardSeekableStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput

public class ForwardSeekableStream
extends SeekableStream

A subclass of SeekableStream that may be used to wrap a regular InputStream efficiently. Seeking backwards is not supported.

This class is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.


Field Summary
(package private)  long markPos
          The marked position.
(package private)  long pointer
          The current position.
private  java.io.InputStream src
          The source InputStream.
 
Fields inherited from class org.ydp.jai.SeekableStream
 
Constructor Summary
ForwardSeekableStream(java.io.InputStream src)
          Constructs a InputStreamForwardSeekableStream from a regular InputStream.
 
Method Summary
 int available()
          Forwards the request to the real InputStream.
 boolean canSeekBackwards()
          Returns false since seking backwards is not supported.
 void close()
          Forwards the request to the real InputStream.
 long getFilePointer()
          Returns the current position in the stream (bytes read).
 void mark(int readLimit)
          Forwards the request to the real InputStream.
 boolean markSupported()
          Forwards the request to the real InputStream.
 int read()
          Forwards the request to the real InputStream.
 int read(byte[] b, int off, int len)
          Forwards the request to the real InputStream.
 void reset()
          Forwards the request to the real InputStream.
 void seek(long pos)
          Seeks forward to the given position in the stream.
 long skip(long n)
          Forwards the request to the real InputStream.
 
Methods inherited from class org.ydp.jai.SeekableStream
finalize, readBoolean, readByte, readChar, readCharLE, readDouble, readDoubleLE, readFloat, readFloatLE, readFully, readFully, readInt, readIntLE, readLine, readLong, readLongLE, readShort, readShortLE, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedShort, readUnsignedShortLE, readUTF, skipBytes, wrapInputStream
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

src

private java.io.InputStream src
The source InputStream.


pointer

long pointer
The current position.


markPos

long markPos
The marked position.

Constructor Detail

ForwardSeekableStream

public ForwardSeekableStream(java.io.InputStream src)
Constructs a InputStreamForwardSeekableStream from a regular InputStream.

Method Detail

read

public final int read()
               throws java.io.IOException
Forwards the request to the real InputStream.

Specified by:
read in class SeekableStream

read

public final int read(byte[] b,
                      int off,
                      int len)
               throws java.io.IOException
Forwards the request to the real InputStream.

Specified by:
read in class SeekableStream

skip

public final long skip(long n)
                throws java.io.IOException
Forwards the request to the real InputStream.


available

public final int available()
                    throws java.io.IOException
Forwards the request to the real InputStream.


close

public final void close()
                 throws java.io.IOException
Forwards the request to the real InputStream.


mark

public final void mark(int readLimit)
Forwards the request to the real InputStream.

Overrides:
mark in class SeekableStream

reset

public final void reset()
                 throws java.io.IOException
Forwards the request to the real InputStream.

Overrides:
reset in class SeekableStream

markSupported

public boolean markSupported()
Forwards the request to the real InputStream.

Overrides:
markSupported in class SeekableStream

canSeekBackwards

public final boolean canSeekBackwards()
Returns false since seking backwards is not supported.

Overrides:
canSeekBackwards in class SeekableStream

getFilePointer

public final long getFilePointer()
Returns the current position in the stream (bytes read).

Specified by:
getFilePointer in class SeekableStream

seek

public final void seek(long pos)
                throws java.io.IOException
Seeks forward to the given position in the stream. If pos is smaller than the current position as returned by getFilePointer(), nothing happens.

Specified by:
seek in class SeekableStream