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 thatpStream
may contain less than this maximum number of bytes.- Throws:
IOException
- ifpStream
's position can't be determined.IllegalArgumentException
- ifpStream == null
orpLength < 0
-
-
Method Details
-
read
- Specified by:
read
in interfaceImageInputStream
- Specified by:
read
in classImageInputStreamImpl
- Throws:
IOException
-
read
- Specified by:
read
in interfaceImageInputStream
- Specified by:
read
in classImageInputStreamImpl
- Throws:
IOException
-
length
public long length()- Specified by:
length
in interfaceImageInputStream
- Overrides:
length
in classImageInputStreamImpl
-
seek
- Specified by:
seek
in interfaceImageInputStream
- Overrides:
seek
in classImageInputStreamImpl
- Throws:
IOException
-
finalize
- Overrides:
finalize
in classImageInputStreamImpl
- Throws:
Throwable
-