commandline.flatFileToBinaryPackage
Class MyDataOutPutStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by commandline.flatFileToBinaryPackage.MyDataOutPutStream
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable
Direct Known Subclasses:
MyTestOutputStream

public class MyDataOutPutStream
extends java.io.DataOutputStream


Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
MyDataOutPutStream(java.io.OutputStream arg0)
           
 
Method Summary
static int getPositiveIntOfNegativeShort(int getal)
          Short is defined between -32768 (MIN_VALUE) and +32767 (MAX_VALUE) if we write a number above 327267 it's written as (N%32767)
 void write(byte[] b)
          writes an array of bytes to the underlying stream
 void writeMyFloat(float getal)
           
 void writeMyInt(int getal)
          Writes an integer
 void writeMyShort(int getal)
           
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyDataOutPutStream

public MyDataOutPutStream(java.io.OutputStream arg0)
Method Detail

writeMyShort

public void writeMyShort(int getal)
                  throws java.io.IOException
Throws:
java.io.IOException

writeMyFloat

public void writeMyFloat(float getal)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
writes an array of bytes to the underlying stream

Specified by:
write in interface java.io.DataOutput
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

writeMyInt

public void writeMyInt(int getal)
                throws java.io.IOException
Writes an integer

Parameters:
getal -
Throws:
java.io.IOException

getPositiveIntOfNegativeShort

public static int getPositiveIntOfNegativeShort(int getal)
Short is defined between -32768 (MIN_VALUE) and +32767 (MAX_VALUE) if we write a number above 327267 it's written as (N%32767)

Parameters:
getal -
Returns:
positive int corresponding to the negative short