Class BigEndianBinaryWriter

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

    public class BigEndianBinaryWriter
    extends BinaryWriter
    IO-Optimized binary writer using big-endian integer encoding.
    • Constructor Detail

      • BigEndianBinaryWriter

        public BigEndianBinaryWriter​(java.io.OutputStream out)
    • Method Detail

      • writeShort

        public int writeShort​(short integer)
                       throws java.io.IOException
        Description copied from class: BinaryWriter
        Write a signed short to the output stream.
        Specified by:
        writeShort in class BinaryWriter
        Parameters:
        integer - The number to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.
      • writeInt

        public int writeInt​(int integer)
                     throws java.io.IOException
        Description copied from class: BinaryWriter
        Write a signed int to the output stream.
        Specified by:
        writeInt in class BinaryWriter
        Parameters:
        integer - The number to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.
      • writeLong

        public int writeLong​(long integer)
                      throws java.io.IOException
        Description copied from class: BinaryWriter
        Write a signed long to the output stream.
        Specified by:
        writeLong in class BinaryWriter
        Parameters:
        integer - The number to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.
      • writeUInt16

        public int writeUInt16​(int number)
                        throws java.io.IOException
        Specified by:
        writeUInt16 in class BinaryWriter
        Parameters:
        number - Unsigned short to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.
      • writeUInt24

        public int writeUInt24​(int number)
                        throws java.io.IOException
        Specified by:
        writeUInt24 in class BinaryWriter
        Parameters:
        number - Unsigned short to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.
      • writeUInt32

        public int writeUInt32​(int number)
                        throws java.io.IOException
        Specified by:
        writeUInt32 in class BinaryWriter
        Parameters:
        number - Unsigned short to writeBinary.
        Returns:
        Number of bytes written.
        Throws:
        java.io.IOException - if unable to write to stream.