Class DataInput

All Implemented Interfaces:
Closeable, AutoCloseable

public final class DataInput extends BufferInput
This is an input stream for project specific data types. It bears resemblance to Java's DataInputStream.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • DataInput

      public DataInput(IO io) throws IOException
      Constructor.
      Parameters:
      io - the input to be read
      Throws:
      IOException - I/O Exception
  • Method Details

    • readBool

      public boolean readBool() throws IOException
      Reads a boolean value.
      Returns:
      boolean value
      Throws:
      IOException - I/O Exception
    • readToken

      public byte[] readToken() throws IOException
      Reads a token, represented by its compressed length and its byte array.
      Returns:
      byte array
      Throws:
      IOException - I/O Exception
    • readDouble

      public double readDouble() throws IOException
      Reads a double value.
      Returns:
      byte array
      Throws:
      IOException - I/O Exception
    • readDiffs

      public IntList readDiffs() throws IOException
      Reads a distance-mapped integer array.
      Returns:
      integer array
      Throws:
      IOException - I/O Exception
    • readNums

      public int[] readNums() throws IOException
      Reads a compressed integer array.
      Returns:
      integer array
      Throws:
      IOException - I/O Exception
    • readTokens

      public byte[][] readTokens() throws IOException
      Reads a token array.
      Returns:
      double array
      Throws:
      IOException - I/O Exception
    • readNum

      public int readNum() throws IOException
      Reads a compressed integer value; see Num for more.
      Returns:
      read value
      Throws:
      IOException - I/O Exception
    • readLongs

      public long[] readLongs(int s) throws IOException
      Reads an array of long values.
      Parameters:
      s - array size
      Returns:
      array of longs
      Throws:
      IOException - I/O Exception