Package net.anwiba.commons.image.imageio
Class SeekableImageInputStream
- java.lang.Object
-
- net.anwiba.commons.image.imageio.SeekableImageInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable,javax.imageio.stream.ImageInputStream
public class SeekableImageInputStream extends java.lang.Object implements javax.imageio.stream.ImageInputStream
-
-
Constructor Summary
Constructors Constructor Description SeekableImageInputStream(org.eclipse.imagen.media.codec.SeekableStream seekableStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckClosed()voidclose()voidflush()voidflushBefore(long pos)intgetBitOffset()java.nio.ByteOrdergetByteOrder()longgetFlushedPosition()longgetStreamPosition()booleanisCached()booleanisCachedFile()booleanisCachedMemory()longlength()voidmark()Pushes the current stream position onto a stack of marked positions.intread()intread(byte[] b)intread(byte[] b, int off, int len)intreadBit()longreadBits(int numBits)booleanreadBoolean()bytereadByte()voidreadBytes(javax.imageio.stream.IIOByteBuffer buf, int len)charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)voidreadFully(char[] c, int off, int len)voidreadFully(double[] d, int off, int len)voidreadFully(float[] f, int off, int len)voidreadFully(int[] i, int off, int len)voidreadFully(long[] l, int off, int len)voidreadFully(short[] s, int off, int len)intreadInt()java.lang.StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()longreadUnsignedInt()intreadUnsignedShort()java.lang.StringreadUTF()voidreset()Resets the current stream byte and bit positions from the stack of marked positions.voidseek(long pos)voidsetBitOffset(int bitOffset)voidsetByteOrder(java.nio.ByteOrder byteOrder)intskipBytes(int n)longskipBytes(long n)
-
-
-
Method Detail
-
checkClosed
protected final void checkClosed() throws java.io.IOException- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- 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- Throws:
java.io.IOException
-
setByteOrder
public void setByteOrder(java.nio.ByteOrder byteOrder)
- Specified by:
setByteOrderin interfacejavax.imageio.stream.ImageInputStream
-
getByteOrder
public java.nio.ByteOrder getByteOrder()
- Specified by:
getByteOrderin interfacejavax.imageio.stream.ImageInputStream
-
read
public int read(byte[] b) throws java.io.IOException- Specified by:
readin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readBytes
public void readBytes(javax.imageio.stream.IIOByteBuffer buf, int len) throws java.io.IOException- Specified by:
readBytesin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readBoolean
public boolean readBoolean() throws java.io.IOException- Specified by:
readBooleanin interfacejava.io.DataInput- Specified by:
readBooleanin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException- Specified by:
readBytein interfacejava.io.DataInput- Specified by:
readBytein interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException- Specified by:
readUnsignedBytein interfacejava.io.DataInput- Specified by:
readUnsignedBytein interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException- Specified by:
readShortin interfacejava.io.DataInput- Specified by:
readShortin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOException- Specified by:
readUnsignedShortin interfacejava.io.DataInput- Specified by:
readUnsignedShortin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOException- Specified by:
readCharin interfacejava.io.DataInput- Specified by:
readCharin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException- Specified by:
readIntin interfacejava.io.DataInput- Specified by:
readIntin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readUnsignedInt
public long readUnsignedInt() throws java.io.IOException- Specified by:
readUnsignedIntin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException- Specified by:
readLongin interfacejava.io.DataInput- Specified by:
readLongin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Specified by:
readFloatin interfacejava.io.DataInput- Specified by:
readFloatin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException- Specified by:
readDoublein interfacejava.io.DataInput- Specified by:
readDoublein interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException- Specified by:
readLinein interfacejava.io.DataInput- Specified by:
readLinein interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOException- Specified by:
readUTFin interfacejava.io.DataInput- Specified by:
readUTFin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejava.io.DataInput- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b) throws java.io.IOException- Specified by:
readFullyin interfacejava.io.DataInput- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(short[] s, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(char[] c, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(int[] i, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(long[] l, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(float[] f, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readFully
public void readFully(double[] d, int off, int len) throws java.io.IOException- Specified by:
readFullyin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
getStreamPosition
public long getStreamPosition() throws java.io.IOException- Specified by:
getStreamPositionin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
getBitOffset
public int getBitOffset() throws java.io.IOException- Specified by:
getBitOffsetin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
setBitOffset
public void setBitOffset(int bitOffset) throws java.io.IOException- Specified by:
setBitOffsetin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readBit
public int readBit() throws java.io.IOException- Specified by:
readBitin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
readBits
public long readBits(int numBits) throws java.io.IOException- Specified by:
readBitsin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
length
public long length() throws java.io.IOException- Specified by:
lengthin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException- Specified by:
skipBytesin interfacejava.io.DataInput- Specified by:
skipBytesin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
skipBytes
public long skipBytes(long n) throws java.io.IOException- Specified by:
skipBytesin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException- Specified by:
seekin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
mark
public void mark()
Pushes the current stream position onto a stack of marked positions.- Specified by:
markin interfacejavax.imageio.stream.ImageInputStream
-
reset
public void reset() throws java.io.IOExceptionResets the current stream byte and bit positions from the stack of marked positions.An
IOExceptionwill be thrown if the previous marked position lies in the discarded portion of the stream.- Specified by:
resetin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException- if an I/O error occurs.
-
flushBefore
public void flushBefore(long pos) throws java.io.IOException- Specified by:
flushBeforein interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejavax.imageio.stream.ImageInputStream- Throws:
java.io.IOException
-
getFlushedPosition
public long getFlushedPosition()
- Specified by:
getFlushedPositionin interfacejavax.imageio.stream.ImageInputStream
-
isCached
public boolean isCached()
- Specified by:
isCachedin interfacejavax.imageio.stream.ImageInputStream
-
isCachedMemory
public boolean isCachedMemory()
- Specified by:
isCachedMemoryin interfacejavax.imageio.stream.ImageInputStream
-
isCachedFile
public boolean isCachedFile()
- Specified by:
isCachedFilein interfacejavax.imageio.stream.ImageInputStream
-
-