Package com.twelvemonkeys.imageio.stream
Class DirectImageInputStream
java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
com.twelvemonkeys.imageio.stream.DirectImageInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,AutoCloseable
,ImageInputStream
An
ImageInputStream
that adapts an InputSteam
,
by reading directly from the stream without and form of caching or buffering.
Note: This is not a general-purpose ImageInputStream
, and is designed for reading large chunks,
typically of pixel data, from an InputStream
.
It does not support backwards seeking, or reading bits.
-
Field Summary
FieldsFields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
-
Constructor Summary
ConstructorsConstructorDescriptionDirectImageInputStream
(InputStream stream) DirectImageInputStream
(InputStream stream, long length) -
Method Summary
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, finalize, flush, flushBefore, getBitOffset, getByteOrder, getStreamPosition, isCached, isCachedFile, isCachedMemory, mark, read, 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
-
Field Details
-
stream
-
length
private final long length
-
-
Constructor Details
-
DirectImageInputStream
-
DirectImageInputStream
-
-
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
-
seek
- Specified by:
seek
in interfaceImageInputStream
- Overrides:
seek
in classImageInputStreamImpl
- Throws:
IOException
-
getFlushedPosition
public long getFlushedPosition()- Specified by:
getFlushedPosition
in interfaceImageInputStream
- Overrides:
getFlushedPosition
in classImageInputStreamImpl
-
length
public long length()- Specified by:
length
in interfaceImageInputStream
- Overrides:
length
in classImageInputStreamImpl
-
readBit
- Specified by:
readBit
in interfaceImageInputStream
- Overrides:
readBit
in classImageInputStreamImpl
- Throws:
IOException
-
readBits
- Specified by:
readBits
in interfaceImageInputStream
- Overrides:
readBits
in classImageInputStreamImpl
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceImageInputStream
- Overrides:
close
in classImageInputStreamImpl
- Throws:
IOException
-