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.ImageInputStream
ByteArrayImageInputStream.
-
-
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 void
flush()
void
flushBefore(long pos)
int
getBitOffset()
java.nio.ByteOrder
getByteOrder()
long
getFlushedPosition()
long
getStreamPosition()
boolean
isCached()
boolean
isCachedFile()
boolean
isCachedMemory()
long
length()
void
mark()
int
readBit()
long
readBits(int numBits)
boolean
readBoolean()
byte
readByte()
void
readBytes(javax.imageio.stream.IIOByteBuffer buf, int len)
char
readChar()
double
readDouble()
float
readFloat()
void
readFully(byte[] b)
void
readFully(byte[] b, int off, int len)
void
readFully(char[] c, int off, int len)
void
readFully(double[] d, int off, int len)
void
readFully(float[] f, int off, int len)
void
readFully(int[] i, int off, int len)
void
readFully(long[] l, int off, int len)
void
readFully(short[] s, int off, int len)
int
readInt()
java.lang.String
readLine()
long
readLong()
short
readShort()
int
readUnsignedByte()
long
readUnsignedInt()
int
readUnsignedShort()
java.lang.String
readUTF()
void
reset()
void
seek(long pos)
void
setBitOffset(int bitOffset)
void
setByteOrder(java.nio.ByteOrder byteOrder)
int
skipBytes(int n)
long
skipBytes(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:
setByteOrder
in interfacejavax.imageio.stream.ImageInputStream
-
getByteOrder
public java.nio.ByteOrder getByteOrder()
- Specified by:
getByteOrder
in interfacejavax.imageio.stream.ImageInputStream
-
readBytes
public void readBytes(javax.imageio.stream.IIOByteBuffer buf, int len) throws java.io.IOException
- Specified by:
readBytes
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readBoolean
public boolean readBoolean() throws java.io.IOException
- Specified by:
readBoolean
in interfacejava.io.DataInput
- Specified by:
readBoolean
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readByte
public byte readByte() throws java.io.IOException
- Specified by:
readByte
in interfacejava.io.DataInput
- Specified by:
readByte
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.IOException
- Specified by:
readUnsignedByte
in interfacejava.io.DataInput
- Specified by:
readUnsignedByte
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException
- Specified by:
readShort
in interfacejava.io.DataInput
- Specified by:
readShort
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.IOException
- Specified by:
readUnsignedShort
in interfacejava.io.DataInput
- Specified by:
readUnsignedShort
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readChar
public char readChar() throws java.io.IOException
- Specified by:
readChar
in interfacejava.io.DataInput
- Specified by:
readChar
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException
- Specified by:
readInt
in interfacejava.io.DataInput
- Specified by:
readInt
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readUnsignedInt
public long readUnsignedInt() throws java.io.IOException
- Specified by:
readUnsignedInt
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException
- Specified by:
readLong
in interfacejava.io.DataInput
- Specified by:
readLong
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException
- Specified by:
readFloat
in interfacejava.io.DataInput
- Specified by:
readFloat
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readDouble
public double readDouble() throws java.io.IOException
- Specified by:
readDouble
in interfacejava.io.DataInput
- Specified by:
readDouble
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException
- Specified by:
readLine
in interfacejava.io.DataInput
- Specified by:
readLine
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readUTF
public java.lang.String readUTF() throws java.io.IOException
- Specified by:
readUTF
in interfacejava.io.DataInput
- Specified by:
readUTF
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejava.io.DataInput
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b) throws java.io.IOException
- Specified by:
readFully
in interfacejava.io.DataInput
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(short[] s, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(char[] c, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(int[] i, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(long[] l, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(float[] f, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readFully
public void readFully(double[] d, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
getStreamPosition
public long getStreamPosition()
- Specified by:
getStreamPosition
in interfacejavax.imageio.stream.ImageInputStream
-
getBitOffset
public int getBitOffset()
- Specified by:
getBitOffset
in interfacejavax.imageio.stream.ImageInputStream
-
setBitOffset
public void setBitOffset(int bitOffset)
- Specified by:
setBitOffset
in interfacejavax.imageio.stream.ImageInputStream
-
readBit
public int readBit() throws java.io.IOException
- Specified by:
readBit
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
readBits
public long readBits(int numBits) throws java.io.IOException
- Specified by:
readBits
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
length
public long length() throws java.io.IOException
- Specified by:
length
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.IOException
- Specified by:
skipBytes
in interfacejava.io.DataInput
- Specified by:
skipBytes
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
skipBytes
public long skipBytes(long n) throws java.io.IOException
- Specified by:
skipBytes
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException
- Specified by:
seek
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
flushBefore
public void flushBefore(long pos) throws java.io.IOException
- Specified by:
flushBefore
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejavax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
-
getFlushedPosition
public long getFlushedPosition()
- Specified by:
getFlushedPosition
in interfacejavax.imageio.stream.ImageInputStream
-
isCached
public boolean isCached()
- Specified by:
isCached
in interfacejavax.imageio.stream.ImageInputStream
-
isCachedMemory
public boolean isCachedMemory()
- Specified by:
isCachedMemory
in interfacejavax.imageio.stream.ImageInputStream
-
isCachedFile
public boolean isCachedFile()
- Specified by:
isCachedFile
in interfacejavax.imageio.stream.ImageInputStream
-
mark
public void mark()
- Specified by:
mark
in interfacejavax.imageio.stream.ImageInputStream
-
reset
public void reset()
- Specified by:
reset
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
reset
in classjava.io.ByteArrayInputStream
-
-