com.jfimagine.utils.io
Interface JFWriter

All Known Implementing Classes:
JFBinaryWriter

public interface JFWriter

JFWriter is a writer interface to handle JFDraw files writing.

Version:
$Revision: 1.1 $
Author:
CookieMaker

Method Summary
 void write(byte[] b)
          Writes to the output stream all the bytes in array b.
 void write(byte[] b, int off, int len)
          Writes len bytes from array b, in order, to the output stream.
 void writeBoolean(boolean v)
          Writes a boolean value to this output stream.
 void writeByte(int v)
          Writes to the output stream the eight low- order bits of the argument v.
 void writeBytes(java.lang.String s)
          Writes a string to the output stream.
 void writeChar(int v)
          Writes a char value, wich is comprised of two bytes, to the output stream.
 void writeChars(java.lang.String s)
          Writes every character in the string s, to the output stream, in order, two bytes per character.
 void writeDouble(double v)
          Writes a double value, which is comprised of eight bytes, to the output stream.
 void writeFloat(float v)
          Writes a float value, which is comprised of four bytes, to the output stream.
 void writeInt(int v)
          Writes an int value, which is comprised of four bytes, to the output stream.
 void writeLong(long v)
          Writes a long value, which is comprised of eight bytes, to the output stream.
 void writeShort(int v)
          Writes two bytes to the output stream to represent the value of the argument.
 void writeUTF(java.lang.String str)
          Writes two bytes of length information to the output stream, followed by the Java modified UTF representation of every character in the string s.
 

Method Detail

write

public void write(byte[] b)
           throws java.io.IOException
Writes to the output stream all the bytes in array b.

Parameters:
b - the data.
Throws:
java.io.IOException - if an I/O error occurs.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from array b, in order, to the output stream.

Parameters:
b - the data.
off - the start offset in the data.
len - the number of bytes to write.
Throws:
java.io.IOException - if an I/O error occurs.

writeBoolean

public void writeBoolean(boolean v)
                  throws java.io.IOException
Writes a boolean value to this output stream. The byte written by this method may be read by the readBoolean method in JFReader.

Parameters:
v - the boolean to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeByte

public void writeByte(int v)
               throws java.io.IOException
Writes to the output stream the eight low- order bits of the argument v. The 24 high-order bits of v are ignored.

Parameters:
v - the byte value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeShort

public void writeShort(int v)
                throws java.io.IOException
Writes two bytes to the output stream to represent the value of the argument. The bytes written by this method may be read by the readShort method in JFReader.

Parameters:
v - the short value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeChar

public void writeChar(int v)
               throws java.io.IOException
Writes a char value, wich is comprised of two bytes, to the output stream. The bytes written by this method may be read by the readChar method in JFReader.

Parameters:
v - the char value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeInt

public void writeInt(int v)
              throws java.io.IOException
Writes an int value, which is comprised of four bytes, to the output stream. The bytes written by this method may be read by the readInt method in JFReader.

Parameters:
v - the int value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeLong

public void writeLong(long v)
               throws java.io.IOException
Writes a long value, which is comprised of eight bytes, to the output stream. The bytes written by this method may be read by the readLong method in JFReader.

Parameters:
v - the long value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeFloat

public void writeFloat(float v)
                throws java.io.IOException
Writes a float value, which is comprised of four bytes, to the output stream. The bytes written by this method may be read by the readFloat method in JFReader.

Parameters:
v - the float value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeDouble

public void writeDouble(double v)
                 throws java.io.IOException
Writes a double value, which is comprised of eight bytes, to the output stream. The bytes written by this method may be read by the readDouble method in JFReader.

Parameters:
v - the double value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeBytes

public void writeBytes(java.lang.String s)
                throws java.io.IOException
Writes a string to the output stream. For every character in the string s, taken in order, one byte is written to the output stream.

Parameters:
s - the string of bytes to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeChars

public void writeChars(java.lang.String s)
                throws java.io.IOException
Writes every character in the string s, to the output stream, in order, two bytes per character.

Parameters:
s - the string value to be written.
Throws:
java.io.IOException - if an I/O error occurs.

writeUTF

public void writeUTF(java.lang.String str)
              throws java.io.IOException
Writes two bytes of length information to the output stream, followed by the Java modified UTF representation of every character in the string s. The bytes written by this method may be read by the readUTF method in JFReader.

Parameters:
str - the string value to be written.
Throws:
java.io.IOException - if an I/O error occurs.


Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All Rights Reserved.