javax.imageio.stream
Class FileCacheImageOutputStream

java.lang.Object
  extended by javax.imageio.stream.ImageInputStreamImpl
      extended by javax.imageio.stream.ImageOutputStreamImpl
          extended by javax.imageio.stream.FileCacheImageOutputStream
All Implemented Interfaces:
DataInput, DataOutput, ImageInputStream, ImageOutputStream

public class FileCacheImageOutputStream
extends ImageOutputStreamImpl


Field Summary
 
Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
 
Constructor Summary
FileCacheImageOutputStream(OutputStream s, File cacheDir)
           
 
Method Summary
 void close()
           
 void flushBefore(long pos)
           
 boolean isCached()
           
 boolean isCachedFile()
           
 boolean isCachedMemory()
           
 long length()
           
 int read()
           
 int read(byte[] data, int offset, int len)
           
 void seek(long pos)
           
 void write(byte[] data, int offset, int len)
          Writes a region of data from an array into the stream.
 void write(int value)
          Writes an int into the stream.
 
Methods inherited from class javax.imageio.stream.ImageOutputStreamImpl
flushBits, write, writeBit, writeBits, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInts, writeLong, writeLongs, writeShort, writeShorts, writeUTF
 
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, finalize, flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, mark, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, setByteOrder, skipBytes, skipBytes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.imageio.stream.ImageInputStream
flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, mark, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, setByteOrder, skipBytes, skipBytes
 

Constructor Detail

FileCacheImageOutputStream

public FileCacheImageOutputStream(OutputStream s,
                                  File cacheDir)
                           throws IOException
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface ImageInputStream
Overrides:
close in class ImageInputStreamImpl
Throws:
IOException

isCached

public boolean isCached()
Specified by:
isCached in interface ImageInputStream
Overrides:
isCached in class ImageInputStreamImpl

isCachedFile

public boolean isCachedFile()
Specified by:
isCachedFile in interface ImageInputStream
Overrides:
isCachedFile in class ImageInputStreamImpl

isCachedMemory

public boolean isCachedMemory()
Specified by:
isCachedMemory in interface ImageInputStream
Overrides:
isCachedMemory in class ImageInputStreamImpl

read

public int read()
         throws IOException
Specified by:
read in interface ImageInputStream
Specified by:
read in class ImageInputStreamImpl
Throws:
IOException

read

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

write

public void write(byte[] data,
                  int offset,
                  int len)
           throws IOException
Description copied from interface: ImageOutputStream
Writes a region of data from an array into the stream.

Specified by:
write in interface DataOutput
Specified by:
write in interface ImageOutputStream
Specified by:
write in class ImageOutputStreamImpl
Parameters:
data - the data to be written
offset - the offset in the array
len - the length in the array
Throws:
IOException - if an errror occurs

write

public void write(int value)
           throws IOException
Description copied from interface: ImageOutputStream
Writes an int into the stream.

Specified by:
write in interface DataOutput
Specified by:
write in interface ImageOutputStream
Specified by:
write in class ImageOutputStreamImpl
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs

length

public long length()
Specified by:
length in interface ImageInputStream
Overrides:
length in class ImageInputStreamImpl

seek

public void seek(long pos)
          throws IOException
Specified by:
seek in interface ImageInputStream
Overrides:
seek in class ImageInputStreamImpl
Throws:
IOException

flushBefore

public void flushBefore(long pos)
                 throws IOException
Specified by:
flushBefore in interface ImageInputStream
Specified by:
flushBefore in interface ImageOutputStream
Overrides:
flushBefore in class ImageInputStreamImpl
Throws:
IOException - if an errror occurs