javax.imageio.stream
Class ImageOutputStreamImpl

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

public abstract class ImageOutputStreamImpl
extends ImageInputStreamImpl
implements ImageOutputStream


Field Summary
 
Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
 
Constructor Summary
ImageOutputStreamImpl()
           
 
Method Summary
protected  void flushBits()
           
 void write(byte[] data)
          Writes an array into the stream.
abstract  void write(byte[] data, int offset, int len)
          Writes a region of data from an array into the stream.
abstract  void write(int value)
          Writes an int into the stream.
 void writeBit(int bit)
          Writes a bit value to the stream.
 void writeBits(long bits, int numBits)
          Writes a number of bit values to the stream.
 void writeBoolean(boolean value)
          Writes a boolean value into the stream.
 void writeByte(int value)
          Writes a byte value into the stream.
 void writeBytes(String data)
          This method writes all the bytes in a String out to the stream.
 void writeChar(int value)
          Writes a character into the stream.
 void writeChars(char[] data, int offset, int len)
          Writes characters to the stream.
 void writeChars(String data)
          Writes characters from a given String into the stream.
 void writeDouble(double value)
          Writes a double into the stream.
 void writeDoubles(double[] data, int offset, int len)
          Writes an array of double into the stream.
 void writeFloat(float value)
          Writes a float into the stream.
 void writeFloats(float[] data, int offset, int len)
          Writes an array of float into the stream.
 void writeInt(int value)
          Writes a int into the stream.
 void writeInts(int[] data, int offset, int len)
          Writes an array of int into the stream.
 void writeLong(long value)
          Writes a long into the stream.
 void writeLongs(long[] data, int offset, int len)
          Writes an array of long into the stream.
 void writeShort(int value)
          Writes a short into the stream.
 void writeShorts(short[] data, int offset, int len)
          Writes an array of short into the stream.
 void writeUTF(String value)
          Writes a String into the stream.
 
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, close, finalize, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, read, 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, seek, 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.ImageOutputStream
flushBefore
 
Methods inherited from interface javax.imageio.stream.ImageInputStream
close, flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, read, 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, seek, setBitOffset, setByteOrder, skipBytes, skipBytes
 

Constructor Detail

ImageOutputStreamImpl

public ImageOutputStreamImpl()
Method Detail

flushBits

protected final void flushBits()
                        throws IOException
Throws:
IOException

write

public void write(byte[] data)
           throws IOException
Description copied from interface: ImageOutputStream
Writes an array into the stream.

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

write

public abstract 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
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 abstract 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
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs

writeBit

public void writeBit(int bit)
              throws IOException
Description copied from interface: ImageOutputStream
Writes a bit value to the stream.

Specified by:
writeBit in interface ImageOutputStream
Throws:
IOException - if an error occurs

writeBits

public void writeBits(long bits,
                      int numBits)
               throws IOException
Description copied from interface: ImageOutputStream
Writes a number of bit values to the stream.

Specified by:
writeBits in interface ImageOutputStream
Throws:
IOException - if an errror occurs

writeBoolean

public void writeBoolean(boolean value)
                  throws IOException
Description copied from interface: ImageOutputStream
Writes a boolean value into the stream.

Specified by:
writeBoolean in interface DataOutput
Specified by:
writeBoolean in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readBoolean()

writeByte

public void writeByte(int value)
               throws IOException
Description copied from interface: ImageOutputStream
Writes a byte value into the stream.

Specified by:
writeByte in interface DataOutput
Specified by:
writeByte in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readByte(), DataInput.readUnsignedByte()

writeBytes

public void writeBytes(String data)
                throws IOException
Description copied from interface: DataOutput
This method writes all the bytes in a String out to the stream. One byte is written for each character in the String. The high eight bits of each character are discarded, thus this method is inappropriate for completely representing Unicode characters.

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

writeChar

public void writeChar(int value)
               throws IOException
Description copied from interface: ImageOutputStream
Writes a character into the stream.

Specified by:
writeChar in interface DataOutput
Specified by:
writeChar in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readChar()

writeChars

public void writeChars(char[] data,
                       int offset,
                       int len)
                throws IOException
Description copied from interface: ImageOutputStream
Writes characters to the stream.

Specified by:
writeChars in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeChars

public void writeChars(String data)
                throws IOException
Description copied from interface: ImageOutputStream
Writes characters from a given String into the stream.

Specified by:
writeChars in interface DataOutput
Specified by:
writeChars in interface ImageOutputStream
Parameters:
data - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataOutput.writeChar(int)

writeDouble

public void writeDouble(double value)
                 throws IOException
Description copied from interface: ImageOutputStream
Writes a double into the stream.

Specified by:
writeDouble in interface DataOutput
Specified by:
writeDouble in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataOutput.writeLong(long), DataInput.readDouble(), Double.doubleToLongBits(double)

writeDoubles

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

Specified by:
writeDoubles in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeFloat

public void writeFloat(float value)
                throws IOException
Description copied from interface: ImageOutputStream
Writes a float into the stream.

Specified by:
writeFloat in interface DataOutput
Specified by:
writeFloat in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataOutput.writeInt(int), DataInput.readFloat(), Float.floatToIntBits(float)

writeFloats

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

Specified by:
writeFloats in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeInt

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

Specified by:
writeInt in interface DataOutput
Specified by:
writeInt in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readInt()

writeInts

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

Specified by:
writeInts in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeLong

public void writeLong(long value)
               throws IOException
Description copied from interface: ImageOutputStream
Writes a long into the stream.

Specified by:
writeLong in interface DataOutput
Specified by:
writeLong in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readLong()

writeLongs

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

Specified by:
writeLongs in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeShort

public void writeShort(int value)
                throws IOException
Description copied from interface: ImageOutputStream
Writes a short into the stream.

Specified by:
writeShort in interface DataOutput
Specified by:
writeShort in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readShort(), DataInput.readUnsignedShort()

writeShorts

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

Specified by:
writeShorts in interface ImageOutputStream
Parameters:
data - the data to be written
offset - the offset in the array
len - the lenth in the array
Throws:
IOException - if an errror occurs

writeUTF

public void writeUTF(String value)
              throws IOException
Description copied from interface: ImageOutputStream
Writes a String into the stream.

Specified by:
writeUTF in interface DataOutput
Specified by:
writeUTF in interface ImageOutputStream
Parameters:
value - the data to be written
Throws:
IOException - if an errror occurs
See Also:
DataInput.readUTF()