Package com.twelvemonkeys.imageio.stream
Class SubImageInputStream
java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
com.twelvemonkeys.imageio.stream.SubImageInputStream
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable,ImageInputStream
A wrapper for
ImageInputStream to limit the number of bytes that can be read.- Version:
- $Id: SubImageInputStream.java,v 1.0 Nov 8, 2009 2:50:58 PM haraldk Exp$
- Author:
- Harald Kuhr, last modified by $Author: haraldk$
-
Field Summary
Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos -
Constructor Summary
ConstructorsConstructorDescriptionSubImageInputStream(ImageInputStream pStream, long pLength) Creates aImageInputStream, reading up to a maximum number of bytes from the underlying stream. -
Method Summary
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, close, 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, setBitOffset, setByteOrder, skipBytes, skipBytes
-
Constructor Details
-
SubImageInputStream
Creates aImageInputStream, reading up to a maximum number of bytes from the underlying stream.- Parameters:
pStream- the underlying streampLength- the maximum length to read from the stream. Note thatpStreammay contain less than this maximum number of bytes.- Throws:
IOException- ifpStream's position can't be determined.IllegalArgumentException- ifpStream == nullorpLength < 0
-
-
Method Details
-
read
- Specified by:
readin interfaceImageInputStream- Specified by:
readin classImageInputStreamImpl- Throws:
IOException
-
read
- Specified by:
readin interfaceImageInputStream- Specified by:
readin classImageInputStreamImpl- Throws:
IOException
-
length
public long length()- Specified by:
lengthin interfaceImageInputStream- Overrides:
lengthin classImageInputStreamImpl
-
seek
- Specified by:
seekin interfaceImageInputStream- Overrides:
seekin classImageInputStreamImpl- Throws:
IOException
-
finalize
- Overrides:
finalizein classImageInputStreamImpl- Throws:
Throwable
-