Package ch.randelshofer.io
Class ByteArrayImageInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- ch.randelshofer.io.ByteArrayImageInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable,ImageInputStream
public class ByteArrayImageInputStream extends ByteArrayInputStream implements ImageInputStream
ByteArrayImageInputStream.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayImageInputStream(byte[] buf)ByteArrayImageInputStream(byte[] buf, int offset, int length, ByteOrder byteOrder)ByteArrayImageInputStream(byte[] buf, ByteOrder byteOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()voidflushBefore(long pos)intgetBitOffset()ByteOrdergetByteOrder()longgetFlushedPosition()longgetStreamPosition()booleanisCached()booleanisCachedFile()booleanisCachedMemory()longlength()voidmark()intreadBit()longreadBits(int numBits)booleanreadBoolean()bytereadByte()voidreadBytes(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()StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()longreadUnsignedInt()intreadUnsignedShort()StringreadUTF()voidreset()voidseek(long pos)voidsetBitOffset(int bitOffset)voidsetByteOrder(ByteOrder byteOrder)intskipBytes(int n)longskipBytes(long n)-
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, skip, transferTo
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readNBytes
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.imageio.stream.ImageInputStream
close, read, read, read
-
-
-
-
Constructor Detail
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf)
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf, ByteOrder byteOrder)
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf, int offset, int length, ByteOrder byteOrder)
-
-
Method Detail
-
setByteOrder
public void setByteOrder(ByteOrder byteOrder)
- Specified by:
setByteOrderin interfaceImageInputStream
-
getByteOrder
public ByteOrder getByteOrder()
- Specified by:
getByteOrderin interfaceImageInputStream
-
readBytes
public void readBytes(IIOByteBuffer buf, int len) throws IOException
- Specified by:
readBytesin interfaceImageInputStream- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Specified by:
readBooleanin interfaceImageInputStream- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Specified by:
readBytein interfaceImageInputStream- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Specified by:
readUnsignedBytein interfaceImageInputStream- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Specified by:
readShortin interfaceImageInputStream- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Specified by:
readUnsignedShortin interfaceImageInputStream- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Specified by:
readCharin interfaceImageInputStream- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Specified by:
readIntin interfaceImageInputStream- Throws:
IOException
-
readUnsignedInt
public long readUnsignedInt() throws IOException- Specified by:
readUnsignedIntin interfaceImageInputStream- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Specified by:
readLongin interfaceImageInputStream- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Specified by:
readFloatin interfaceImageInputStream- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Specified by:
readDoublein interfaceImageInputStream- Throws:
IOException
-
readLine
public String readLine() throws IOException
- Specified by:
readLinein interfaceDataInput- Specified by:
readLinein interfaceImageInputStream- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Specified by:
readUTFin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(short[] s, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(char[] c, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(int[] i, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(long[] l, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(float[] f, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
readFully
public void readFully(double[] d, int off, int len) throws IOException- Specified by:
readFullyin interfaceImageInputStream- Throws:
IOException
-
getStreamPosition
public long getStreamPosition()
- Specified by:
getStreamPositionin interfaceImageInputStream
-
getBitOffset
public int getBitOffset()
- Specified by:
getBitOffsetin interfaceImageInputStream
-
setBitOffset
public void setBitOffset(int bitOffset)
- Specified by:
setBitOffsetin interfaceImageInputStream
-
readBit
public int readBit() throws IOException- Specified by:
readBitin interfaceImageInputStream- Throws:
IOException
-
readBits
public long readBits(int numBits) throws IOException- Specified by:
readBitsin interfaceImageInputStream- Throws:
IOException
-
length
public long length() throws IOException- Specified by:
lengthin interfaceImageInputStream- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Specified by:
skipBytesin interfaceImageInputStream- Throws:
IOException
-
skipBytes
public long skipBytes(long n) throws IOException- Specified by:
skipBytesin interfaceImageInputStream- Throws:
IOException
-
seek
public void seek(long pos) throws IOException- Specified by:
seekin interfaceImageInputStream- Throws:
IOException
-
flushBefore
public void flushBefore(long pos) throws IOException- Specified by:
flushBeforein interfaceImageInputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceImageInputStream- Throws:
IOException
-
getFlushedPosition
public long getFlushedPosition()
- Specified by:
getFlushedPositionin interfaceImageInputStream
-
isCached
public boolean isCached()
- Specified by:
isCachedin interfaceImageInputStream
-
isCachedMemory
public boolean isCachedMemory()
- Specified by:
isCachedMemoryin interfaceImageInputStream
-
isCachedFile
public boolean isCachedFile()
- Specified by:
isCachedFilein interfaceImageInputStream
-
mark
public void mark()
- Specified by:
markin interfaceImageInputStream
-
reset
public void reset()
- Specified by:
resetin interfaceImageInputStream- Overrides:
resetin classByteArrayInputStream
-
-