Class EndianOutputStream

  • All Implemented Interfaces:
    EndianDataOutput, java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable

    public class EndianOutputStream
    extends java.io.OutputStream
    implements EndianDataOutput
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.io.DataOutputStream dos  
      protected static org.slf4j.Logger sLogger  
      protected int toSkip  
    • Constructor Summary

      Constructors 
      Constructor Description
      EndianOutputStream​(java.io.OutputStream out)
      Wrap any other OutputStream to provide both little-endian and big-endian data output operations.
      EndianOutputStream​(java.io.OutputStream out, int skip)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean checkWriteSkip​(int n)  
      void close()  
      void flush()  
      void write​(byte[] src)  
      void write​(byte[] src, int offset, int length)  
      void write​(int b)  
      void writeBoolean​(boolean v)  
      void writeByte​(int v)  
      void writeBytes​(java.lang.String s)  
      void writeChar​(int v)  
      void writeCharLE​(int v)
      Little-endian counterpart to writeChar().
      void writeChars​(java.lang.String s)  
      void writeCharsLE​(java.lang.String s)
      Little-endian counterpart to writeChars().
      void writeDouble​(double v)  
      void writeDoubleLE​(double v)
      Little-endian counterpart to writeDouble().
      void writeFloat​(float v)  
      void writeFloatLE​(float f)
      Little-endian counterpart to writeFloat().
      void writeInt​(int v)  
      void writeIntLE​(int v)
      Little-endian counterpart to writeInt().
      void writeLong​(long v)  
      void writeLongLE​(long v)
      Little-endian counterpart to writeLong().
      void writeShort​(int v)  
      void writeShortLE​(int v)
      Little-endian counterpart to writeShort().
      void writeUTF​(java.lang.String s)  
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sLogger

        protected static org.slf4j.Logger sLogger
      • dos

        protected final java.io.DataOutputStream dos
      • toSkip

        protected int toSkip
    • Constructor Detail

      • EndianOutputStream

        public EndianOutputStream​(java.io.OutputStream out)
        Wrap any other OutputStream to provide both little-endian and big-endian data output operations.
        Parameters:
        out - The stream to wrap.
      • EndianOutputStream

        public EndianOutputStream​(java.io.OutputStream out,
                                  int skip)
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] src)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] src,
                          int offset,
                          int length)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Overrides:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException
      • writeBoolean

        public void writeBoolean​(boolean v)
                          throws java.io.IOException
        Specified by:
        writeBoolean in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeByte

        public void writeByte​(int v)
                       throws java.io.IOException
        Specified by:
        writeByte in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • checkWriteSkip

        protected boolean checkWriteSkip​(int n)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • writeShort

        public void writeShort​(int v)
                        throws java.io.IOException
        Specified by:
        writeShort in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeChar

        public void writeChar​(int v)
                       throws java.io.IOException
        Specified by:
        writeChar in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeInt

        public void writeInt​(int v)
                      throws java.io.IOException
        Specified by:
        writeInt in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeLong

        public void writeLong​(long v)
                       throws java.io.IOException
        Specified by:
        writeLong in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeFloat

        public void writeFloat​(float v)
                        throws java.io.IOException
        Specified by:
        writeFloat in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeDouble

        public void writeDouble​(double v)
                         throws java.io.IOException
        Specified by:
        writeDouble in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeBytes

        public void writeBytes​(java.lang.String s)
                        throws java.io.IOException
        Specified by:
        writeBytes in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeChars

        public void writeChars​(java.lang.String s)
                        throws java.io.IOException
        Specified by:
        writeChars in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeUTF

        public void writeUTF​(java.lang.String s)
                      throws java.io.IOException
        Specified by:
        writeUTF in interface java.io.DataOutput
        Throws:
        java.io.IOException
      • writeCharLE

        public void writeCharLE​(int v)
                         throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeChar().
        Specified by:
        writeCharLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeCharsLE

        public void writeCharsLE​(java.lang.String s)
                          throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeChars().
        Specified by:
        writeCharsLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeDoubleLE

        public void writeDoubleLE​(double v)
                           throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeDouble().
        Specified by:
        writeDoubleLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeFloatLE

        public void writeFloatLE​(float f)
                          throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeFloat().
        Specified by:
        writeFloatLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeShortLE

        public void writeShortLE​(int v)
                          throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeShort().
        Specified by:
        writeShortLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeIntLE

        public void writeIntLE​(int v)
                        throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeInt().
        Specified by:
        writeIntLE in interface EndianDataOutput
        Throws:
        java.io.IOException
      • writeLongLE

        public void writeLongLE​(long v)
                         throws java.io.IOException
        Description copied from interface: EndianDataOutput
        Little-endian counterpart to writeLong().
        Specified by:
        writeLongLE in interface EndianDataOutput
        Throws:
        java.io.IOException