org.egothor.io
Class DataInputOutputStream

java.lang.Object
  extended by org.egothor.io.DataInputStream
      extended by org.egothor.io.DataInputOutputStream
All Implemented Interfaces:
DataInput, DataOutput

public abstract class DataInputOutputStream
extends DataInputStream
implements DataOutput


Constructor Summary
DataInputOutputStream()
           
 
Method Summary
 void copyFrom(DataInput in, int length)
          Copies bytes of a given length from input stream.
abstract  int directRead(long from, byte[] arr)
          Read from the offset position without buffering.
abstract  void directWrite(long at, byte[] buf)
           
 void printUTFS(java.lang.String str, int firstIndex, int lastIndex)
          Prints a string portion.
abstract  byte readByte()
          Description of the Method
abstract  int readFully(byte[] arr)
          Description of the Method
abstract  void write(byte[] buf, int offset, int len)
           
 void writeBoolean(boolean value)
           
abstract  void writeByte(int val)
          Write the given byte, which will be converted to Pack7 format.
 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()
           
 
Methods inherited from class org.egothor.io.DataInputStream
close, getFilePointer, getMarkPointer, jump, length, mark, read, readBoolean, readInt, readLong, readPack7, readPack7I, readShort, readString, readString, seek, skipBytes, skipPack7, skipPack7I
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataInputOutputStream

public DataInputOutputStream()
Method Detail

writeFully

public final void writeFully(byte[] buf)
                      throws java.io.IOException
Description copied from interface: DataOutput
Description of the Method

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

written

public abstract long written()
Specified by:
written in interface DataOutput

writeByte

public abstract void writeByte(int val)
                        throws java.io.IOException
Description copied from interface: DataOutput
Write the given byte, which will be converted to Pack7 format.

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

writeLong

public void writeLong(long val)
               throws java.io.IOException
Description copied from interface: DataOutput
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
Specified by:
write in interface DataOutput
Throws:
java.io.IOException

writePack7

public final void writePack7(long val)
                      throws java.io.IOException
Description copied from interface: DataOutput
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
Description copied from interface: DataOutput
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

readByte

public abstract byte readByte()
                       throws java.io.IOException
Description copied from class: DataInputStream
Description of the Method

Specified by:
readByte in interface DataInput
Specified by:
readByte in class DataInputStream
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readFully

public abstract int readFully(byte[] arr)
                       throws java.io.IOException
Description copied from class: DataInputStream
Description of the Method

Specified by:
readFully in interface DataInput
Specified by:
readFully in class DataInputStream
Parameters:
arr - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

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

directRead

public abstract int directRead(long from,
                               byte[] arr)
                        throws java.io.IOException
Description copied from interface: DataInput
Read from the offset position without buffering. This operation moves the read head which may collide with buffered methods.

Specified by:
directRead in interface DataInput
Specified by:
directRead in class DataInputStream
Throws:
java.io.IOException

directWrite

public abstract void directWrite(long at,
                                 byte[] buf)
                          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