javax.imageio.stream
Interface ImageOutputStream

All Superinterfaces:
DataInput, DataOutput, ImageInputStream
All Known Implementing Classes:
FileCacheImageOutputStream, FileImageOutputStream, ImageOutputStreamImpl, MemoryCacheImageOutputStream

public interface ImageOutputStream
extends ImageInputStream, DataOutput

An output stream for use by ImageWriters.

Since:
1.4

Method Summary
 void flushBefore(long position)
           
 void write(byte[] data)
          Writes an array into the stream.
 void write(byte[] data, int offset, int len)
          Writes a region of data from an array into the stream.
 void write(int data)
          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 data)
          Writes a boolean value into the stream.
 void writeByte(int data)
          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 data)
          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 data)
          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 data)
          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 data)
          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 data)
          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 data)
          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 data)
          Writes a String into the stream.
 
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
 

Method Detail

flushBefore

void flushBefore(long position)
                 throws IOException
Specified by:
flushBefore in interface ImageInputStream
Parameters:
position -
Throws:
IOException - if an errror occurs

write

void write(byte[] data)
           throws IOException
Writes an array into the stream.

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

write

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

Specified by:
write in interface DataOutput
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

void write(int data)
           throws IOException
Writes an int into the stream.

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

writeBit

void writeBit(int bit)
              throws IOException
Writes a bit value to the stream.

Throws:
IOException - if an error occurs

writeBits

void writeBits(long bits,
               int numBits)
               throws IOException
Writes a number of bit values to the stream.

Throws:
IOException - if an errror occurs

writeBoolean

void writeBoolean(boolean data)
                  throws IOException
Writes a boolean value into the stream.

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

writeByte

void writeByte(int data)
               throws IOException
Writes a byte value into the stream.

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

writeBytes

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

writeChar

void writeChar(int data)
               throws IOException
Writes a character into the stream.

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

writeChars

void writeChars(char[] data,
                int offset,
                int len)
                throws IOException
Writes characters to the stream.

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

void writeChars(String data)
                throws IOException
Writes characters from a given String into the stream.

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

writeDouble

void writeDouble(double data)
                 throws IOException
Writes a double into the stream.

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

writeDoubles

void writeDoubles(double[] data,
                  int offset,
                  int len)
                  throws IOException
Writes an array of double into the stream.

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

void writeFloat(float data)
                throws IOException
Writes a float into the stream.

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

writeFloats

void writeFloats(float[] data,
                 int offset,
                 int len)
                 throws IOException
Writes an array of float into the stream.

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

void writeInt(int data)
              throws IOException
Writes a int into the stream.

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

writeInts

void writeInts(int[] data,
               int offset,
               int len)
               throws IOException
Writes an array of int into the stream.

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

void writeLong(long data)
               throws IOException
Writes a long into the stream.

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

writeLongs

void writeLongs(long[] data,
                int offset,
                int len)
                throws IOException
Writes an array of long into the stream.

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

void writeShort(int data)
                throws IOException
Writes a short into the stream.

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

writeShorts

void writeShorts(short[] data,
                 int offset,
                 int len)
                 throws IOException
Writes an array of short into the stream.

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

void writeUTF(String data)
              throws IOException
Writes a String into the stream.

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