Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
Field Summary | |
protected int | |
protected ByteOrder | |
protected long | |
protected long |
Constructor Summary | |
|
Method Summary | |
protected void | |
void |
|
protected void |
|
void |
|
void |
|
int | |
ByteOrder | |
long | |
long | |
boolean |
|
boolean | |
boolean | |
long |
|
void |
|
abstract int |
|
int |
|
abstract int |
|
int |
|
long |
|
boolean |
|
byte |
|
void |
|
char |
|
double |
|
float |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
int |
|
String |
|
long |
|
short |
|
String |
|
int |
|
long |
|
int |
|
void |
|
void |
|
void |
|
void |
|
int |
|
long |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public ImageInputStreamImpl()
The basic constructor. Object is special, because it has no superclass, so there is no call to super().
protected void finalize() throws Throwable
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from thejava.lang.ref
package. Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simplysuper.finalize()
. finalize() will be called by aThread
that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work. If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed. It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again. Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically callssuper.finalize()
. The default implementation does nothing.
- Throws:
Throwable
- permits a subclass to throw anything in an overridden version; but the default throws nothing
- See Also:
System.gc()
,System.runFinalizersOnExit(boolean)
,java.lang.ref
public void flushBefore(long position) throws IOException
- Specified by:
- flushBefore in interface ImageInputStream
public int getBitOffset() throws IOException
- Specified by:
- getBitOffset in interface ImageInputStream
public long getFlushedPosition()
- Specified by:
- getFlushedPosition in interface ImageInputStream
public long getStreamPosition() throws IOException
- Specified by:
- getStreamPosition in interface ImageInputStream
public boolean isCachedMemory()
- Specified by:
- isCachedMemory in interface ImageInputStream
public abstract int read(byte[] data, int offset, int len) throws IOException
- Specified by:
- read in interface ImageInputStream
public long readBits(int numBits) throws IOException
- Specified by:
- readBits in interface ImageInputStream
public boolean readBoolean() throws IOException
Reads a byte and checks whether or not its value is zero. The bit offset is set to zero before the byte is read.
- Specified by:
- readBoolean in interface ImageInputStream
- readBoolean in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public byte readByte() throws IOException
Reads a signed byte. The bit offset is set to zero before any data is read.
- Specified by:
- readByte in interface ImageInputStream
- readByte in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public void readBytes(IIOByteBuffer buffer, int len) throws IOException
Reads up to a specified number of bytes, and modifies aIIOByteBuffer
to hold the read data. The bit offset is set to zero before any data is read.
- Specified by:
- readBytes in interface ImageInputStream
- Parameters:
- Throws:
IndexOutOfBoundsException
- ifnumBytes
is negative.NullPointerException
- ifbuf
isnull
.IOException
- if some general problem happens with accessing data.
public char readChar() throws IOException
Reads an unsigned 16-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read. This method does the same asImageInputStream.readUnsignedShort()
.
- Specified by:
- readChar in interface ImageInputStream
- readChar in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public double readDouble() throws IOException
Reads an IEEE 64-bit double-precision floating point number. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readDouble in interface ImageInputStream
- readDouble in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public float readFloat() throws IOException
Reads an IEEE 32-bit single-precision floating point number. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFloat in interface ImageInputStream
- readFloat in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public void readFully(byte[] data) throws IOException
Reads a sequence of signed 8-bit integers into abyte[]
array. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- readFully in interface DataInput
- Parameters:
- Throws:
NullPointerException
- ifb
isnull
.IOException
- if some general problem happens with accessing data.
public void readFully(byte[] data, int offset, int len) throws IOException
Reads a sequence of signed 8-bit integers into abyte[]
array. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- readFully in interface DataInput
- Parameters:
offset
- the index of the first element inb
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumBytes
is negative, or ifoffset + numBytes
exceedsb.length
.NullPointerException
- ifb
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readByte()
public void readFully(char[] data, int offset, int len) throws IOException
Reads a sequence of unsigned 16-bit integers into achar[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element inc
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumChars
is negative, or ifoffset + numChars
exceedsc.length
.NullPointerException
- ifc
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readChar()
public void readFully(double[] data, int offset, int len) throws IOException
Reads a sequence of IEEE 64-bit double-precision floating point numbers into adouble[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element ind
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumDoubles
is negative, or ifoffset + numDoubles
exceedsd.length
.NullPointerException
- ifd
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readDouble()
public void readFully(float[] data, int offset, int len) throws IOException
Reads a sequence of IEEE 32-bit single-precision floating point numbers into afloat[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element ind
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumFloats
is negative, or ifoffset + numFloats
exceedsf.length
.NullPointerException
- iff
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readFloat()
public void readFully(int[] data, int offset, int len) throws IOException
Reads a sequence of signed 32-bit integers into along[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element ini
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumInts
is negative, or ifoffset + numInts
exceedsi.length
.NullPointerException
- ifi
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readInt()
public void readFully(long[] data, int offset, int len) throws IOException
Reads a sequence of signed 64-bit integers into along[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element inl
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumLongs
is negative, or ifoffset + numLongs
exceedsl.length
.NullPointerException
- ifl
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readLong()
public void readFully(short[] data, int offset, int len) throws IOException
Reads a sequence of signed 16-bit integers into ashort[]
array. If necessary, values are converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readFully in interface ImageInputStream
- Parameters:
offset
- the index of the first element ins
that will hold read data.
- Throws:
IndexOutOfBoundsException
- ifoffset
ornumShorts
is negative, or ifoffset + numShorts
exceedss.length
.NullPointerException
- ifs
isnull
.IOException
- if some general problem happens with accessing data.
- See Also:
ImageInputStream.readShort()
public int readInt() throws IOException
Reads a signed 32-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readInt in interface ImageInputStream
- readInt in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public String readLine() throws IOException
- Specified by:
- readLine in interface ImageInputStream
- readLine in interface DataInput
public long readLong() throws IOException
Reads a signed 64-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readLong in interface ImageInputStream
- readLong in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public short readShort() throws IOException
Reads an signed 16-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readShort in interface ImageInputStream
- readShort in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public String readUTF() throws IOException
- Specified by:
- readUTF in interface ImageInputStream
- readUTF in interface DataInput
public int readUnsignedByte() throws IOException
Reads an unsigned byte. The bit offset is set to zero before any data is read.
- Specified by:
- readUnsignedByte in interface ImageInputStream
- readUnsignedByte in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public long readUnsignedInt() throws IOException
Reads an unsigned 32-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read.
- Specified by:
- readUnsignedInt in interface ImageInputStream
- Throws:
IOException
- if some general problem happens with accessing data.
public int readUnsignedShort() throws IOException
Reads an unsigned 16-bit integer. If necessary, the value gets converted from the stream’s current byte order. The bit offset is set to zero before any data is read. This method does the same asImageInputStream.readChar()
.
- Specified by:
- readUnsignedShort in interface ImageInputStream
- readUnsignedShort in interface DataInput
- Throws:
IOException
- if some general problem happens with accessing data.
public void seek(long position) throws IOException
- Specified by:
- seek in interface ImageInputStream
public void setBitOffset(int bitOffset) throws IOException
- Specified by:
- setBitOffset in interface ImageInputStream
public void setByteOrder(ByteOrder byteOrder)
- Specified by:
- setByteOrder in interface ImageInputStream
public int skipBytes(int num) throws IOException
- Specified by:
- skipBytes in interface ImageInputStream
- skipBytes in interface DataInput
public long skipBytes(long num) throws IOException
- Specified by:
- skipBytes in interface ImageInputStream