Class WriteBMP32.LittleEndianOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable
    Enclosing class:
    WriteBMP32

    public static class WriteBMP32.LittleEndianOutputStream
    extends java.io.DataOutputStream
    • Field Summary

      • Fields inherited from class java.io.DataOutputStream

        written
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      LittleEndianOutputStream​(java.io.OutputStream out)
      Creates a new instance of LittleEndianOutputStream, which will write to the specified target.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static double swapDouble​(double value)
      Reverses the byte order of the source double value
      static float swapFloat​(float value)
      Reverses the byte order of the source float value
      static int swapInteger​(int value)
      Reverses the byte order of the source int value
      static long swapLong​(long value)
      Reverses the byte order of the source long value
      static short swapShort​(short value)
      Reverses the byte order of the source short value
      static java.lang.StringBuilder toCharString​(java.lang.StringBuilder sb, int i, int bytes, char def)  
      static java.lang.String toHexString​(int i, boolean littleEndian, int bytes)  
      static java.lang.String toInfoString​(int info)  
      void writeDoubleLE​(double value)
      Writes a little-endian double value
      void writeFloatLE​(float value)
      Writes a little-endian float value
      void writeIntLE​(int value)
      Writes a little-endian int value
      void writeLongLE​(long value)
      Writes a little-endian long value
      void writeShortLE​(short value)
      Writes a little-endian short value
      void writeUnsignedInt​(long value)  
      void writeUnsignedIntLE​(long value)  
      • 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, write
      • 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
      • Methods inherited from interface java.io.DataOutput

        write
    • Constructor Detail

      • LittleEndianOutputStream

        public LittleEndianOutputStream​(java.io.OutputStream out)
        Creates a new instance of LittleEndianOutputStream, which will write to the specified target.
        Parameters:
        out - the target OutputStream
    • Method Detail

      • swapShort

        public static short swapShort​(short value)
        Reverses the byte order of the source short value
        Parameters:
        value - the source value
        Returns:
        the converted value
      • swapInteger

        public static int swapInteger​(int value)
        Reverses the byte order of the source int value
        Parameters:
        value - the source value
        Returns:
        the converted value
      • swapLong

        public static long swapLong​(long value)
        Reverses the byte order of the source long value
        Parameters:
        value - the source value
        Returns:
        the converted value
      • swapFloat

        public static float swapFloat​(float value)
        Reverses the byte order of the source float value
        Parameters:
        value - the source value
        Returns:
        the converted value
      • swapDouble

        public static double swapDouble​(double value)
        Reverses the byte order of the source double value
        Parameters:
        value - the source value
        Returns:
        the converted value
      • toHexString

        public static java.lang.String toHexString​(int i,
                                                   boolean littleEndian,
                                                   int bytes)
      • toCharString

        public static java.lang.StringBuilder toCharString​(java.lang.StringBuilder sb,
                                                           int i,
                                                           int bytes,
                                                           char def)
      • toInfoString

        public static java.lang.String toInfoString​(int info)
      • writeShortLE

        public void writeShortLE​(short value)
                          throws java.io.IOException
        Writes a little-endian short value
        Parameters:
        value - the source value to convert
        Throws:
        java.io.IOException - if an error occurs
      • writeIntLE

        public void writeIntLE​(int value)
                        throws java.io.IOException
        Writes a little-endian int value
        Parameters:
        value - the source value to convert
        Throws:
        java.io.IOException - if an error occurs
      • writeFloatLE

        public void writeFloatLE​(float value)
                          throws java.io.IOException
        Writes a little-endian float value
        Parameters:
        value - the source value to convert
        Throws:
        java.io.IOException - if an error occurs
      • writeLongLE

        public void writeLongLE​(long value)
                         throws java.io.IOException
        Writes a little-endian long value
        Parameters:
        value - the source value to convert
        Throws:
        java.io.IOException - if an error occurs
      • writeDoubleLE

        public void writeDoubleLE​(double value)
                           throws java.io.IOException
        Writes a little-endian double value
        Parameters:
        value - the source value to convert
        Throws:
        java.io.IOException - if an error occurs
      • writeUnsignedInt

        public void writeUnsignedInt​(long value)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUnsignedIntLE

        public void writeUnsignedIntLE​(long value)
                                throws java.io.IOException
        Throws:
        java.io.IOException