javax.imageio.stream

Class ImageInputStreamImpl

Implemented Interfaces:
DataInput, ImageInputStream
Known Direct Subclasses:
FileCacheImageInputStream, FileImageInputStream, ImageOutputStreamImpl, JPEGImageInputStream, MemoryCacheImageInputStream

public abstract class ImageInputStreamImpl
extends Object
implements ImageInputStream

Field Summary

protected int
bitOffset
protected ByteOrder
byteOrder
protected long
flushedPos
protected long
streamPos

Constructor Summary

ImageInputStreamImpl()
The basic constructor.

Method Summary

protected void
checkClosed()
void
close()
protected void
finalize()
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.
void
flush()
void
flushBefore(long position)
int
getBitOffset()
ByteOrder
getByteOrder()
long
getFlushedPosition()
long
getStreamPosition()
boolean
isCached()
boolean
isCachedFile()
boolean
isCachedMemory()
long
length()
void
mark()
abstract int
read()
int
read(byte[] data)
abstract int
read(byte[] data, int offset, int len)
int
readBit()
long
readBits(int numBits)
boolean
readBoolean()
byte
readByte()
void
readBytes(IIOByteBuffer buffer, int len)
char
readChar()
double
readDouble()
float
readFloat()
void
readFully(byte[] data)
void
readFully(byte[] data, int offset, int len)
void
readFully(char[] data, int offset, int len)
void
readFully(double[] data, int offset, int len)
void
readFully(float[] data, int offset, int len)
void
readFully(int[] data, int offset, int len)
void
readFully(long[] data, int offset, int len)
void
readFully(short[] data, int offset, int len)
int
readInt()
String
readLine()
long
readLong()
short
readShort()
String
readUTF()
int
readUnsignedByte()
long
readUnsignedInt()
int
readUnsignedShort()
void
reset()
void
seek(long position)
void
setBitOffset(int bitOffset)
void
setByteOrder(ByteOrder byteOrder)
int
skipBytes(int num)
long
skipBytes(long num)

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

bitOffset

protected int bitOffset

byteOrder

protected ByteOrder byteOrder

flushedPos

protected long flushedPos

streamPos

protected long streamPos

Constructor Details

ImageInputStreamImpl

public ImageInputStreamImpl()
The basic constructor. Object is special, because it has no superclass, so there is no call to super().

Method Details

checkClosed

protected final void checkClosed()
            throws IOException

close

public void close()
            throws IOException
Specified by:
close in interface ImageInputStream

finalize

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 the java.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 simply super.finalize().

finalize() will be called by a Thread 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 calls super.finalize().

The default implementation does nothing.

Overrides:
finalize in interface Object
Throws:
Throwable - permits a subclass to throw anything in an overridden version; but the default throws nothing

flush

public void flush()
            throws IOException
Specified by:
flush in interface ImageInputStream

flushBefore

public void flushBefore(long position)
            throws IOException
Specified by:
flushBefore in interface ImageInputStream

getBitOffset

public int getBitOffset()
            throws IOException
Specified by:
getBitOffset in interface ImageInputStream

getByteOrder

public ByteOrder getByteOrder()
Specified by:
getByteOrder in interface ImageInputStream

getFlushedPosition

public long getFlushedPosition()
Specified by:
getFlushedPosition in interface ImageInputStream

getStreamPosition

public long getStreamPosition()
            throws IOException
Specified by:
getStreamPosition in interface ImageInputStream

isCached

public boolean isCached()
Specified by:
isCached in interface ImageInputStream

isCachedFile

public boolean isCachedFile()
Specified by:
isCachedFile in interface ImageInputStream

isCachedMemory

public boolean isCachedMemory()
Specified by:
isCachedMemory in interface ImageInputStream

length

public long length()
Specified by:
length in interface ImageInputStream

mark

public void mark()
Specified by:
mark in interface ImageInputStream

read

public abstract int read()
            throws IOException
Specified by:
read in interface ImageInputStream

read

public int read(byte[] data)
            throws IOException
Specified by:
read in interface ImageInputStream

read

public abstract int read(byte[] data,
                         int offset,
                         int len)
            throws IOException
Specified by:
read in interface ImageInputStream

readBit

public int readBit()
            throws IOException
Specified by:
readBit in interface ImageInputStream

readBits

public long readBits(int numBits)
            throws IOException
Specified by:
readBits in interface ImageInputStream

readBoolean

public boolean readBoolean()
            throws IOException
Specified by:
readBoolean in interface ImageInputStream
readBoolean in interface DataInput

readByte

public byte readByte()
            throws IOException
Specified by:
readByte in interface ImageInputStream
readByte in interface DataInput

readBytes

public void readBytes(IIOByteBuffer buffer,
                      int len)
            throws IOException
Specified by:
readBytes in interface ImageInputStream

readChar

public char readChar()
            throws IOException
Specified by:
readChar in interface ImageInputStream
readChar in interface DataInput

readDouble

public double readDouble()
            throws IOException
Specified by:
readDouble in interface ImageInputStream
readDouble in interface DataInput

readFloat

public float readFloat()
            throws IOException
Specified by:
readFloat in interface ImageInputStream
readFloat in interface DataInput

readFully

public void readFully(byte[] data)
            throws IOException
Specified by:
readFully in interface ImageInputStream
readFully in interface DataInput

readFully

public void readFully(byte[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream
readFully in interface DataInput

readFully

public void readFully(char[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readFully

public void readFully(double[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readFully

public void readFully(float[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readFully

public void readFully(int[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readFully

public void readFully(long[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readFully

public void readFully(short[] data,
                      int offset,
                      int len)
            throws IOException
Specified by:
readFully in interface ImageInputStream

readInt

public int readInt()
            throws IOException
Specified by:
readInt in interface ImageInputStream
readInt in interface DataInput

readLine

public String readLine()
            throws IOException
Specified by:
readLine in interface ImageInputStream
readLine in interface DataInput

readLong

public long readLong()
            throws IOException
Specified by:
readLong in interface ImageInputStream
readLong in interface DataInput

readShort

public short readShort()
            throws IOException
Specified by:
readShort in interface ImageInputStream
readShort in interface DataInput

readUTF

public String readUTF()
            throws IOException
Specified by:
readUTF in interface ImageInputStream
readUTF in interface DataInput

readUnsignedByte

public int readUnsignedByte()
            throws IOException
Specified by:
readUnsignedByte in interface ImageInputStream
readUnsignedByte in interface DataInput

readUnsignedInt

public long readUnsignedInt()
            throws IOException
Specified by:
readUnsignedInt in interface ImageInputStream

readUnsignedShort

public int readUnsignedShort()
            throws IOException
Specified by:
readUnsignedShort in interface ImageInputStream
readUnsignedShort in interface DataInput

reset

public void reset()
            throws IOException
Specified by:
reset in interface ImageInputStream

seek

public void seek(long position)
            throws IOException
Specified by:
seek in interface ImageInputStream

setBitOffset

public void setBitOffset(int bitOffset)
            throws IOException
Specified by:
setBitOffset in interface ImageInputStream

setByteOrder

public void setByteOrder(ByteOrder byteOrder)
Specified by:
setByteOrder in interface ImageInputStream

skipBytes

public int skipBytes(int num)
            throws IOException
Specified by:
skipBytes in interface ImageInputStream
skipBytes in interface DataInput

skipBytes

public long skipBytes(long num)
            throws IOException
Specified by:
skipBytes in interface ImageInputStream

ImageInputStream.java -- Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.