com.vividsolutions.jump.io
Class EndianDataOutputStream

java.lang.Object
  extended by com.vividsolutions.jump.io.EndianDataOutputStream

public class EndianDataOutputStream
extends java.lang.Object

A class that gives most of the functionality of DataOutputStream, but is endian aware. Uses a real java.io.DataOutputStream to actually do the writing.


Constructor Summary
EndianDataOutputStream(java.io.OutputStream out)
          Creates new EndianDataOutputStream
 
Method Summary
 void close()
          close stream
 void flush()
          flush stream
 void write(byte[] b, int off, int len)
          write bytes
 void writeByteBE(int b)
          write a byte in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte
 void writeByteLE(int b)
          write a byte in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte
 void writeBytesBE(java.lang.String s)
          write a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte
 void writeBytesLE(java.lang.String s)
          write a set of bytes in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte
 void writeDoubleBE(double d)
          write a 64bit double in BigEndian
 void writeDoubleLE(double d)
          write a 64bit double in LittleEndian
 void writeIntBE(int i)
          write a 32bit int in BigEndian
 void writeIntLE(int i)
          write a 32bit int in LittleEndian
 void writeLongBE(long l)
          write a 64bit long in BigEndian
 void writeLongLE(long l)
          write a 64bit long in LittleEndian
 void writeShortBE(int s)
          write a 16bit short in BigEndian
 void writeShortLE(int s)
          write a 16bit short in LittleEndian
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndianDataOutputStream

public EndianDataOutputStream(java.io.OutputStream out)
Creates new EndianDataOutputStream

Method Detail

close

public void close()
           throws java.io.IOException
close stream

Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
write bytes

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
flush stream

Throws:
java.io.IOException

writeByteLE

public void writeByteLE(int b)
                 throws java.io.IOException
write a byte in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte

Throws:
java.io.IOException

writeByteBE

public void writeByteBE(int b)
                 throws java.io.IOException
write a byte in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte

Throws:
java.io.IOException

writeBytesLE

public void writeBytesLE(java.lang.String s)
                  throws java.io.IOException
write a set of bytes in LittleEndian - this is exactly the same as the BigEndian version since there's no endian in a single byte

Throws:
java.io.IOException

writeBytesBE

public void writeBytesBE(java.lang.String s)
                  throws java.io.IOException
write a set of bytes in BigEndian - this is exactly the same as the LittleEndian version since there's no endian in a single byte

Throws:
java.io.IOException

writeShortBE

public void writeShortBE(int s)
                  throws java.io.IOException
write a 16bit short in BigEndian

Throws:
java.io.IOException

writeShortLE

public void writeShortLE(int s)
                  throws java.io.IOException
write a 16bit short in LittleEndian

Throws:
java.io.IOException

writeIntBE

public void writeIntBE(int i)
                throws java.io.IOException
write a 32bit int in BigEndian

Throws:
java.io.IOException

writeIntLE

public void writeIntLE(int i)
                throws java.io.IOException
write a 32bit int in LittleEndian

Throws:
java.io.IOException

writeLongBE

public void writeLongBE(long l)
                 throws java.io.IOException
write a 64bit long in BigEndian

Throws:
java.io.IOException

writeLongLE

public void writeLongLE(long l)
                 throws java.io.IOException
write a 64bit long in LittleEndian

Throws:
java.io.IOException

writeDoubleBE

public void writeDoubleBE(double d)
                   throws java.io.IOException
write a 64bit double in BigEndian

Throws:
java.io.IOException

writeDoubleLE

public void writeDoubleLE(double d)
                   throws java.io.IOException
write a 64bit double in LittleEndian

Throws:
java.io.IOException