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, javax.imageio.stream.ImageInputStream
public class ByteArrayImageInputStream
- extends java.io.ByteArrayInputStream
- implements javax.imageio.stream.ImageInputStream
ByteArrayImageInputStream.
- Version:
- 1.0 2008-10-18 Created.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Immensee
|
Field Summary |
protected int |
bitOffset
The current bit offset within the stream. |
protected java.nio.ByteOrder |
byteOrder
The byte order of the stream as an instance of the enumeration
class java.nio.ByteOrder, where
ByteOrder.BIG_ENDIAN indicates network byte order
and ByteOrder.LITTLE_ENDIAN indicates the reverse
order. |
| Fields inherited from class java.io.ByteArrayInputStream |
buf, count, mark, pos |
|
Method Summary |
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, skip |
| Methods inherited from class java.io.InputStream |
read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.imageio.stream.ImageInputStream |
close, read, read, read |
byteOrder
protected java.nio.ByteOrder byteOrder
- The byte order of the stream as an instance of the enumeration
class
java.nio.ByteOrder, where
ByteOrder.BIG_ENDIAN indicates network byte order
and ByteOrder.LITTLE_ENDIAN indicates the reverse
order. By default, the value is
ByteOrder.BIG_ENDIAN.
bitOffset
protected int bitOffset
- The current bit offset within the stream. Subclasses are
responsible for keeping this value current from any method they
override that alters the bit offset.
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)
setByteOrder
public void setByteOrder(java.nio.ByteOrder byteOrder)
- Specified by:
setByteOrder in interface javax.imageio.stream.ImageInputStream
getByteOrder
public java.nio.ByteOrder getByteOrder()
- Specified by:
getByteOrder in interface javax.imageio.stream.ImageInputStream
readBytes
public void readBytes(javax.imageio.stream.IIOByteBuffer buf,
int len)
throws java.io.IOException
- Specified by:
readBytes in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readBoolean
public boolean readBoolean()
throws java.io.IOException
- Specified by:
readBoolean in interface java.io.DataInput- Specified by:
readBoolean in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readByte
public byte readByte()
throws java.io.IOException
- Specified by:
readByte in interface java.io.DataInput- Specified by:
readByte in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readUnsignedByte
public int readUnsignedByte()
throws java.io.IOException
- Specified by:
readUnsignedByte in interface java.io.DataInput- Specified by:
readUnsignedByte in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readShort
public short readShort()
throws java.io.IOException
- Specified by:
readShort in interface java.io.DataInput- Specified by:
readShort in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readUnsignedShort
public int readUnsignedShort()
throws java.io.IOException
- Specified by:
readUnsignedShort in interface java.io.DataInput- Specified by:
readUnsignedShort in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readChar
public char readChar()
throws java.io.IOException
- Specified by:
readChar in interface java.io.DataInput- Specified by:
readChar in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readInt
public int readInt()
throws java.io.IOException
- Specified by:
readInt in interface java.io.DataInput- Specified by:
readInt in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readUnsignedInt
public long readUnsignedInt()
throws java.io.IOException
- Specified by:
readUnsignedInt in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readLong
public long readLong()
throws java.io.IOException
- Specified by:
readLong in interface java.io.DataInput- Specified by:
readLong in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readFloat
public float readFloat()
throws java.io.IOException
- Specified by:
readFloat in interface java.io.DataInput- Specified by:
readFloat in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readDouble
public double readDouble()
throws java.io.IOException
- Specified by:
readDouble in interface java.io.DataInput- Specified by:
readDouble in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readLine
public java.lang.String readLine()
throws java.io.IOException
- Specified by:
readLine in interface java.io.DataInput- Specified by:
readLine in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readUTF
public java.lang.String readUTF()
throws java.io.IOException
- Specified by:
readUTF in interface java.io.DataInput- Specified by:
readUTF in interface javax.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 interface java.io.DataInput- Specified by:
readFully in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readFully
public void readFully(byte[] b)
throws java.io.IOException
- Specified by:
readFully in interface java.io.DataInput- Specified by:
readFully in interface javax.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 interface javax.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 interface javax.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 interface javax.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 interface javax.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 interface javax.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 interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
getStreamPosition
public long getStreamPosition()
- Specified by:
getStreamPosition in interface javax.imageio.stream.ImageInputStream
getBitOffset
public int getBitOffset()
- Specified by:
getBitOffset in interface javax.imageio.stream.ImageInputStream
setBitOffset
public void setBitOffset(int bitOffset)
- Specified by:
setBitOffset in interface javax.imageio.stream.ImageInputStream
readBit
public int readBit()
throws java.io.IOException
- Specified by:
readBit in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
readBits
public long readBits(int numBits)
throws java.io.IOException
- Specified by:
readBits in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
length
public long length()
throws java.io.IOException
- Specified by:
length in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
skipBytes
public int skipBytes(int n)
throws java.io.IOException
- Specified by:
skipBytes in interface java.io.DataInput- Specified by:
skipBytes in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
skipBytes
public long skipBytes(long n)
throws java.io.IOException
- Specified by:
skipBytes in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
seek
public void seek(long pos)
throws java.io.IOException
- Specified by:
seek in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
flushBefore
public void flushBefore(long pos)
throws java.io.IOException
- Specified by:
flushBefore in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush in interface javax.imageio.stream.ImageInputStream
- Throws:
java.io.IOException
getFlushedPosition
public long getFlushedPosition()
- Specified by:
getFlushedPosition in interface javax.imageio.stream.ImageInputStream
isCached
public boolean isCached()
- Specified by:
isCached in interface javax.imageio.stream.ImageInputStream
isCachedMemory
public boolean isCachedMemory()
- Specified by:
isCachedMemory in interface javax.imageio.stream.ImageInputStream
isCachedFile
public boolean isCachedFile()
- Specified by:
isCachedFile in interface javax.imageio.stream.ImageInputStream
mark
public void mark()
- Specified by:
mark in interface javax.imageio.stream.ImageInputStream
reset
public void reset()
- Specified by:
reset in interface javax.imageio.stream.ImageInputStream- Overrides:
reset in class java.io.ByteArrayInputStream