Package com.twelvemonkeys.imageio.stream
Class DirectImageInputStream
- java.lang.Object
-
- javax.imageio.stream.ImageInputStreamImpl
-
- com.twelvemonkeys.imageio.stream.DirectImageInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable,javax.imageio.stream.ImageInputStream
public final class DirectImageInputStream extends javax.imageio.stream.ImageInputStreamImplAnImageInputStreamthat adapts anInputSteam, 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 anInputStream. It does not support backwards seeking, or reading bits.
-
-
Constructor Summary
Constructors Constructor Description DirectImageInputStream(java.io.InputStream stream)DirectImageInputStream(java.io.InputStream stream, long length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetFlushedPosition()longlength()intread()intread(byte[] bytes, int off, int len)intreadBit()longreadBits(int numBits)voidseek(long pos)-
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
-
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Specified by:
readin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
read
public int read(byte[] bytes, int off, int len) throws java.io.IOException- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Specified by:
readin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException- Specified by:
seekin interfacejavax.imageio.stream.ImageInputStream- Overrides:
seekin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
getFlushedPosition
public long getFlushedPosition()
- Specified by:
getFlushedPositionin interfacejavax.imageio.stream.ImageInputStream- Overrides:
getFlushedPositionin classjavax.imageio.stream.ImageInputStreamImpl
-
length
public long length()
- Specified by:
lengthin interfacejavax.imageio.stream.ImageInputStream- Overrides:
lengthin classjavax.imageio.stream.ImageInputStreamImpl
-
readBit
public int readBit() throws java.io.IOException- Specified by:
readBitin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readBitin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
readBits
public long readBits(int numBits) throws java.io.IOException- Specified by:
readBitsin interfacejavax.imageio.stream.ImageInputStream- Overrides:
readBitsin classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejavax.imageio.stream.ImageInputStream- Overrides:
closein classjavax.imageio.stream.ImageInputStreamImpl- Throws:
java.io.IOException
-
-