public class IISRandomAccessIO extends java.lang.Object implements RandomAccessIO
ImageInputStream into a
RandomAccessIO. The resulting class is read-only.| Constructor and Description |
|---|
IISRandomAccessIO(javax.imageio.stream.ImageInputStream iis)
Creates a
RandomAccessIO instance from the supplied
ImageInputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the I/O stream.
|
void |
flush()
A null operation as writing is not supported.
|
int |
getByteOrdering()
Returns the endianess (i.e., byte ordering) of the implementing
class.
|
int |
getPos()
Returns the stream position clamped to a maximum of
Integer.MAX_VALUE. |
int |
length()
Returns the length of the data stream.
|
int |
read()
Reads a byte of data from the stream.
|
byte |
readByte()
Should read a signed byte (i.e., 8 bit) from the input.
|
double |
readDouble()
Should read an IEEE double precision (i.e., 64 bit)
floating-point number from the input.
|
float |
readFloat()
Should read an IEEE single precision (i.e., 32 bit)
floating-point number from the input.
|
void |
readFully(byte[] b,
int off,
int n)
Reads up to len bytes of data from this file into an array of
bytes.
|
int |
readInt()
Should read a signed int (i.e., 32 bit) from the input.
|
long |
readLong()
Should read a signed long (i.e., 64 bit) from the input.
|
short |
readShort()
Should read a signed short (i.e., 16 bit) from the input.
|
int |
readUnsignedByte()
Should read an unsigned byte (i.e., 8 bit) from the input.
|
long |
readUnsignedInt()
Should read an unsigned int (i.e., 32 bit) from the input.
|
int |
readUnsignedShort()
Should read an unsigned short (i.e., 16 bit) from the input.
|
void |
seek(int off)
Moves the current position for the next read or write operation to
offset.
|
int |
skipBytes(int n)
Skips n bytes from the input.
|
void |
write(int b)
Throws an
IOException as writing is not supported. |
void |
writeByte(int v)
Throws an
IOException as writing is not supported. |
void |
writeDouble(double v)
Throws an
IOException as writing is not supported. |
void |
writeFloat(float v)
Throws an
IOException as writing is not supported. |
void |
writeInt(int v)
Throws an
IOException as writing is not supported. |
void |
writeLong(long v)
Throws an
IOException as writing is not supported. |
void |
writeShort(int v)
Throws an
IOException as writing is not supported. |
public IISRandomAccessIO(javax.imageio.stream.ImageInputStream iis)
RandomAccessIO instance from the supplied
ImageInputStream.iis - The source ImageInputStream.public void close()
throws java.io.IOException
RandomAccessIOclose in interface RandomAccessIOjava.io.IOException - If an I/O error ocurred.public int getPos()
throws java.io.IOException
Integer.MAX_VALUE.getPos in interface RandomAccessIOjava.io.IOException - If an I/O error ocurred.public void seek(int off)
throws java.io.IOException
RandomAccessIOseek in interface RandomAccessIOoff - The offset where to move to.java.io.EOFException - If in read-only and seeking beyond EOF.java.io.IOException - If an I/O error ocurred.public int length()
throws java.io.IOException
If the length of the ImageInputStream is not
-1, then it is returned after being clamped to
a maximum value of Integer.MAX_VALUE. If the
ImageInputStream is -1, the stream
is read to a maximum position of Integer.MAX_VALUE
and its final position is returned. The position of the stream
is unchanged from the value it had prior to the call.
length in interface RandomAccessIOjava.io.IOException - If an I/O error ocurred.public int read()
throws java.io.IOException
RandomAccessIOread in interface RandomAccessIOjava.io.EOFException - If the end-of file was reached.java.io.IOException - If an I/O error ocurred.public void readFully(byte[] b,
int off,
int n)
throws java.io.IOException
RandomAccessIOreadFully in interface RandomAccessIOb - The buffer into which the data is to be read. It must be long
enough.off - The index in 'b' where to place the first byte read.n - The number of bytes to read.java.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public int getByteOrdering()
BinaryDataInputgetByteOrdering in interface BinaryDataInputgetByteOrdering in interface BinaryDataOutputEndianTypepublic byte readByte()
throws java.io.IOException
BinaryDataInputreadByte in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public int readUnsignedByte()
throws java.io.IOException
BinaryDataInputreadUnsignedByte in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public short readShort()
throws java.io.IOException
BinaryDataInputreadShort in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public int readUnsignedShort()
throws java.io.IOException
BinaryDataInputreadUnsignedShort in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public int readInt()
throws java.io.IOException
BinaryDataInputreadInt in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public long readUnsignedInt()
throws java.io.IOException
BinaryDataInputreadUnsignedInt in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public long readLong()
throws java.io.IOException
BinaryDataInputreadLong in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public float readFloat()
throws java.io.IOException
BinaryDataInputreadFloat in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public double readDouble()
throws java.io.IOException
BinaryDataInputreadDouble in interface BinaryDataInputjava.io.EOFException - If the end-of file was reached before
getting all the necessary data.java.io.IOException - If an I/O error ocurred.public int skipBytes(int n)
throws java.io.IOException
BinaryDataInputskipBytes in interface BinaryDataInputn - The number of bytes to skipjava.io.EOFException - If the end-of file was reached before
all the bytes could be skipped.java.io.IOException - If an I/O error ocurred.public void flush()
flush in interface BinaryDataOutputpublic void write(int b)
throws java.io.IOException
IOException as writing is not supported.write in interface RandomAccessIOb - The byte to write. The lower 8 bits of b are
written.java.io.IOException - If an I/O error ocurred.public void writeByte(int v)
throws java.io.IOException
IOException as writing is not supported.writeByte in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.public void writeShort(int v)
throws java.io.IOException
IOException as writing is not supported.writeShort in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.public void writeInt(int v)
throws java.io.IOException
IOException as writing is not supported.writeInt in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.public void writeLong(long v)
throws java.io.IOException
IOException as writing is not supported.writeLong in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.public void writeFloat(float v)
throws java.io.IOException
IOException as writing is not supported.writeFloat in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.public void writeDouble(double v)
throws java.io.IOException
IOException as writing is not supported.writeDouble in interface BinaryDataOutputv - The value to write to the outputjava.io.IOException - If an I/O error ocurred.Copyright © 2014 Open Microscopy Environment