Package ch.randelshofer.io
Class ByteArrayImageInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- ch.randelshofer.io.ByteArrayImageInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.DataInput,java.lang.AutoCloseable,javax.imageio.stream.ImageInputStream
public class ByteArrayImageInputStream extends java.io.ByteArrayInputStream implements javax.imageio.stream.ImageInputStreamByteArrayImageInputStream.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayImageInputStream(byte[] buf)ByteArrayImageInputStream(byte[] buf, int offset, int length, java.nio.ByteOrder byteOrder)ByteArrayImageInputStream(byte[] buf, java.nio.ByteOrder byteOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()voidflushBefore(long pos)intgetBitOffset()java.nio.ByteOrdergetByteOrder()longgetFlushedPosition()longgetStreamPosition()booleanisCached()booleanisCachedFile()booleanisCachedMemory()longlength()voidmark()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()voidseek(long pos)voidsetBitOffset(int bitOffset)voidsetByteOrder(java.nio.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
-
-
-
-
Constructor Detail
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf)
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf, java.nio.ByteOrder byteOrder)
-
ByteArrayImageInputStream
public ByteArrayImageInputStream(byte[] buf, int offset, int length, java.nio.ByteOrder byteOrder)
-
-
Method Detail
-
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
-
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()
- Specified by:
getStreamPositionin interfacejavax.imageio.stream.ImageInputStream
-
getBitOffset
public int getBitOffset()
- Specified by:
getBitOffsetin interfacejavax.imageio.stream.ImageInputStream
-
setBitOffset
public void setBitOffset(int bitOffset)
- Specified by:
setBitOffsetin interfacejavax.imageio.stream.ImageInputStream
-
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
-
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
-
mark
public void mark()
- Specified by:
markin interfacejavax.imageio.stream.ImageInputStream
-
reset
public void reset()
- Specified by:
resetin interfacejavax.imageio.stream.ImageInputStream- Overrides:
resetin classjava.io.ByteArrayInputStream
-
-