org.egothor.io
Class DataOutputStream

java.lang.Object
  extended by org.egothor.io.DataOutputStream
All Implemented Interfaces:
DataOutput
Direct Known Subclasses:
GZipOutputStream, MemoryOutputStream

public abstract class DataOutputStream
extends java.lang.Object
implements DataOutput

This class is part of the Egothor Project

Author:
Leo Galambos

Constructor Summary
DataOutputStream()
           
 
Method Summary
 void close()
          Description of the Method
static void copyFrom(DataInput in, DataOutput out, int length)
           
 void copyFrom(DataInput in, int length)
          Copies bytes of a given length from input stream.
abstract  void flush()
           
 void printUTFS(java.lang.String str, int firstIndex, int lastIndex)
          Prints a string portion.
abstract  void write(byte[] buf, int offset, int len)
          Description of the Method
 void writeBoolean(boolean value)
           
abstract  void writeByte(int val)
          Description of the Method
 void writeFully(byte[] buf)
          Description of the Method
 void writeInt(int val)
          Description of the Method
 void writeLong(long val)
          Description of the Method
 void writePack7(long val)
          Write the given long, which will be converted to Pack7 format.
 void writePack7I(int val)
          Write the given integer, which will be converted to Pack7 format.
 void writeShort(int val)
          Description of the Method
 void writeString(int from, java.lang.String str)
          Write a string as length (pack7) followed by UTF code of the string.
abstract  long written()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataOutputStream

public DataOutputStream()
Method Detail

writeFully

public final void writeFully(byte[] buf)
                      throws java.io.IOException
Description of the Method

Specified by:
writeFully in interface DataOutput
Parameters:
buf - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

close

public void close()
           throws java.io.IOException
Description of the Method

Throws:
java.io.IOException - Description of the Exception

written

public abstract long written()
Description of the Method

Specified by:
written in interface DataOutput
Returns:
Description of the Return Value

writeByte

public abstract void writeByte(int val)
                        throws java.io.IOException
Description of the Method

Specified by:
writeByte in interface DataOutput
Parameters:
val - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writeLong

public void writeLong(long val)
               throws java.io.IOException
Description of the Method

Specified by:
writeLong in interface DataOutput
Parameters:
val - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writeInt

public void writeInt(int val)
              throws java.io.IOException
Description of the Method

Specified by:
writeInt in interface DataOutput
Parameters:
val - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writeShort

public void writeShort(int val)
                throws java.io.IOException
Description of the Method

Specified by:
writeShort in interface DataOutput
Parameters:
val - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

write

public abstract void write(byte[] buf,
                           int offset,
                           int len)
                    throws java.io.IOException
Description of the Method

Specified by:
write in interface DataOutput
Parameters:
buf - Description of the Parameter
offset - Description of the Parameter
len - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writePack7

public final void writePack7(long val)
                      throws java.io.IOException
Write the given long, which will be converted to Pack7 format.

Specified by:
writePack7 in interface DataOutput
Parameters:
val - the long to convert and write
Throws:
java.io.IOException - if an I/O error occurs

writePack7I

public final void writePack7I(int val)
                       throws java.io.IOException
Write the given integer, which will be converted to Pack7 format.

Specified by:
writePack7I in interface DataOutput
Parameters:
val - the integer to convert and write
Throws:
java.io.IOException - if an I/O error occurs

writeString

public void writeString(int from,
                        java.lang.String str)
                 throws java.io.IOException
Write a string as length (pack7) followed by UTF code of the string.

Specified by:
writeString in interface DataOutput
Parameters:
from - Description of the Parameter
str - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writeBoolean

public void writeBoolean(boolean value)
                  throws java.io.IOException
Specified by:
writeBoolean in interface DataOutput
Throws:
java.io.IOException

printUTFS

public void printUTFS(java.lang.String str,
                      int firstIndex,
                      int lastIndex)
               throws java.io.IOException
Description copied from interface: DataOutput
Prints a string portion.

Specified by:
printUTFS in interface DataOutput
Parameters:
str - Description of the Parameter
firstIndex - Description of the Parameter
lastIndex - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

copyFrom

public static void copyFrom(DataInput in,
                            DataOutput out,
                            int length)
                     throws java.io.IOException
Throws:
java.io.IOException

copyFrom

public void copyFrom(DataInput in,
                     int length)
              throws java.io.IOException
Description copied from interface: DataOutput
Copies bytes of a given length from input stream. If the length is lower than zero, then the full input stream (til EOF) is copied.

Specified by:
copyFrom in interface DataOutput
Throws:
java.io.IOException

flush

public abstract void flush()
                    throws java.io.IOException
Throws:
java.io.IOException