public class SubInputStream extends ImageInputStreamImpl
ImageInputStream which is able to provide a view of a specific part of
the wrapped stream. Read accesses to the wrapped stream are synchronized, so that users of this
stream need to deal with synchronization against other users of the same instance, but not
against other users of the wrapped stream.| Modifier and Type | Field and Description |
|---|---|
protected long |
length
The length of the window.
|
protected long |
offset
The position in the wrapped stream at which the window starts.
|
protected ImageInputStream |
wrappedStream |
bitOffset, byteOrder, flushedPos, streamPos| Constructor and Description |
|---|
SubInputStream(ImageInputStream iis,
long offset,
long length)
Construct a new SubInputStream which provides a view of the wrapped stream.
|
| Modifier and Type | Method and Description |
|---|---|
long |
length() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
skipBits()
Skips remaining bits in the current byte.
|
checkClosed, close, finalize, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, mark, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytesprotected final ImageInputStream wrappedStream
protected final long offset
protected final long length
public SubInputStream(ImageInputStream iis, long offset, long length)
iis - - The stream to be wrapped.offset - - The absolute position in the wrapped stream at which the sub-stream starts.length - - The length of the sub-stream.public int read()
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic long length()
length in interface ImageInputStreamlength in class ImageInputStreamImplpublic void skipBits()
Copyright © 2015. All rights reserved.