APIdia Launch Partner
Top Fields Constructors Methods
com.sun.imageio.plugins.common

public final Class SubImageInputStream

extends ImageInputStreamImpl
Class Inheritance
Imports
java.io.IOException, javax.imageio.stream.ImageInputStreamImpl, .ImageInputStream

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv long
pack-priv ImageInputStream
Inherited from javax.imageio.stream.ImageInputStreamImpl:
bitOffsetbyteOrderflushedPosstreamPos

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public long
length()

Overrides javax.imageio.stream.ImageInputStreamImpl.length.

Implements javax.imageio.stream.ImageInputStream.length.

Returns -1L to indicate that the stream has unknown length.

public int
read()

Implements abstract javax.imageio.stream.ImageInputStreamImpl.read.

Implements javax.imageio.stream.ImageInputStream.read.

Reads a single byte from the stream and returns it as an int between 0 and 255.

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

Implements abstract javax.imageio.stream.ImageInputStreamImpl.read.

Implements javax.imageio.stream.ImageInputStream.read.

Reads up to len bytes from the stream, and stores them into b starting at index off.

public void
seek(long pos)

Overrides javax.imageio.stream.ImageInputStreamImpl.seek.

Implements javax.imageio.stream.ImageInputStream.seek.

Sets the current stream position to the desired location.

Inherited from javax.imageio.stream.ImageInputStreamImpl:
checkClosedcloseflushflushBeforegetBitOffsetgetByteOrdergetFlushedPositiongetStreamPositionisCachedisCachedFileisCachedMemorymarkreadreadBitreadBitsreadBooleanreadBytereadBytesreadCharreadDoublereadFloatreadFullyreadFullyreadFullyreadFullyreadFullyreadFullyreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedIntreadUnsignedShortreadUTFresetsetBitOffsetsetByteOrderskipBytesskipBytes

Field Detail

lengthback to summary
pack-priv int length
startingLengthback to summary
pack-priv int startingLength
startingPosback to summary
pack-priv long startingPos
streamback to summary
pack-priv ImageInputStream stream

Constructor Detail

SubImageInputStreamback to summary
public SubImageInputStream(ImageInputStream stream, int length) throws IOException

Method Detail

lengthback to summary
public long length()

Overrides javax.imageio.stream.ImageInputStreamImpl.length.

Implements javax.imageio.stream.ImageInputStream.length.

Doc from javax.imageio.stream.ImageInputStreamImpl.length.

Returns -1L to indicate that the stream has unknown length. Subclasses must override this method to provide actual length information.

Annotations
@Override
readback to summary
public int read() throws IOException

Implements abstract javax.imageio.stream.ImageInputStreamImpl.read.

Implements javax.imageio.stream.ImageInputStream.read.

Doc from javax.imageio.stream.ImageInputStreamImpl.read.

Reads a single byte from the stream and returns it as an int between 0 and 255. If EOF is reached, -1 is returned.

Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.

The bit offset within the stream must be reset to zero before the read occurs.

Annotations
@Override
Exceptions
IOException:
if the stream has been closed.
readback to summary
public int read(byte[] b, int off, int len) throws IOException

Implements abstract javax.imageio.stream.ImageInputStreamImpl.read.

Implements javax.imageio.stream.ImageInputStream.read.

Doc from javax.imageio.stream.ImageInputStreamImpl.read.

Reads up to len bytes from the stream, and stores them into b starting at index off. If no bytes can be read because the end of the stream has been reached, -1 is returned.

The bit offset within the stream must be reset to zero before the read occurs.

Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
seekback to summary
public void seek(long pos) throws IOException

Overrides javax.imageio.stream.ImageInputStreamImpl.seek.

Implements javax.imageio.stream.ImageInputStream.seek.

Doc from javax.imageio.stream.ImageInputStream.seek.

Sets the current stream position to the desired location. The next read will occur at this location. The bit offset is set to 0.

An IndexOutOfBoundsException will be thrown if pos is smaller than the flushed position (as returned by getflushedPosition).

It is legal to seek past the end of the file; a java.io.EOFException will be thrown only if a read is performed.

Annotations
@Override
Exceptions
IOException:
if any other I/O error occurs.