Class Endian

java.lang.Object
org.archive.io.Endian

public class Endian extends Object
Reads integers stored in big or little endian streams.
Author:
pjack
  • Method Details

    • littleChar

      public static char littleChar(InputStream input) throws IOException
      Reads the next little-endian unsigned 16 bit integer from the given stream.
      Parameters:
      input - the input stream to read from
      Returns:
      the next 16-bit little-endian integer
      Throws:
      IOException - if an IO error occurs
    • littleShort

      public static short littleShort(InputStream input) throws IOException
      Reads the next little-endian signed 16-bit integer from the given stream.
      Parameters:
      input - the input stream to read from
      Returns:
      the next 16-bit little-endian integer
      Throws:
      IOException - if an IO error occurs
    • littleInt

      public static int littleInt(InputStream input) throws IOException
      Reads the next little-endian signed 32-bit integer from the given stream.
      Parameters:
      input - the input stream to read from
      Returns:
      the next 32-bit little-endian integer
      Throws:
      IOException - if an IO error occurs
    • bigChar

      public static char bigChar(InputStream input) throws IOException
      Reads the next big-endian unsigned 16 bit integer from the given stream.
      Parameters:
      input - the input stream to read from
      Returns:
      the next 16-bit big-endian integer
      Throws:
      IOException - if an IO error occurs
    • bigInt

      public static int bigInt(InputStream input) throws IOException
      Reads the next big-endian signed 32-bit integer from the given stream.
      Parameters:
      input - the input stream to read from
      Returns:
      the next 32-bit big-endian integer
      Throws:
      IOException - if an IO error occurs