Class LittleEndianRandomAccessDataInput

java.lang.Object
com.ardor3d.util.LittleEndianRandomAccessDataInput
All Implemented Interfaces:
DataInput

public class LittleEndianRandomAccessDataInput extends Object implements DataInput
Utility class useful for reading little-endian stored data in a random access fashion. All functions work as defined in DataInput, but assume they come from a LittleEndian input stream.

Note: random access is implemented by reading the entire stream into memory.

  • Field Details

    • CHAR_SIZE

      public int CHAR_SIZE
      Number of bytes to read when reading a char... For data meant to be read from C/C++ this is often 1, for Java and C# this is usually 2.
  • Constructor Details

    • LittleEndianRandomAccessDataInput

      public LittleEndianRandomAccessDataInput(InputStream in) throws IOException
      Creates a new LittleEndian reader from the given input stream. Note that this stream is loaded completely into memory.
      Parameters:
      in - The stream to read from.
      Throws:
      IOException - if something wrong occurs while reading
    • LittleEndianRandomAccessDataInput

      public LittleEndianRandomAccessDataInput(ByteBuffer contents) throws IOException
      Creates a new LittleEndian reader from the given byte buffer. Note that this byte buffer is not cloned or copied, so take care not to alter it during read. This constructor is useful for working with memory-mapped files.
      Parameters:
      contents - The contents to read from.
      Throws:
      IOException - if something wrong occurs while reading
  • Method Details