Class EndianDataOutputStream

java.lang.Object
com.vividsolutions.jump.io.EndianDataOutputStream
All Implemented Interfaces:
AutoCloseable

public class EndianDataOutputStream extends Object implements AutoCloseable
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

    Constructors
    Constructor
    Description
    Creates new EndianDataOutputStream
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close stream
    void
    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
    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
    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 Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EndianDataOutputStream

      public EndianDataOutputStream(OutputStream out)
      Creates new EndianDataOutputStream
  • Method Details

    • close

      public void close() throws IOException
      close stream
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      write bytes
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      flush stream
      Throws:
      IOException
    • writeByteLE

      public void writeByteLE(int b) throws 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:
      IOException
    • writeByteBE

      public void writeByteBE(int b) throws 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:
      IOException
    • writeBytesLE

      public void writeBytesLE(String s) throws 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:
      IOException
    • writeBytesBE

      public void writeBytesBE(String s) throws 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:
      IOException
    • writeShortBE

      public void writeShortBE(int s) throws IOException
      write a 16bit short in BigEndian
      Throws:
      IOException
    • writeShortLE

      public void writeShortLE(int s) throws IOException
      write a 16bit short in LittleEndian
      Throws:
      IOException
    • writeIntBE

      public void writeIntBE(int i) throws IOException
      write a 32bit int in BigEndian
      Throws:
      IOException
    • writeIntLE

      public void writeIntLE(int i) throws IOException
      write a 32bit int in LittleEndian
      Throws:
      IOException
    • writeLongBE

      public void writeLongBE(long l) throws IOException
      write a 64bit long in BigEndian
      Throws:
      IOException
    • writeLongLE

      public void writeLongLE(long l) throws IOException
      write a 64bit long in LittleEndian
      Throws:
      IOException
    • writeDoubleBE

      public void writeDoubleBE(double d) throws IOException
      write a 64bit double in BigEndian
      Throws:
      IOException
    • writeDoubleLE

      public void writeDoubleLE(double d) throws IOException
      write a 64bit double in LittleEndian
      Throws:
      IOException