Package org.basex.io.in
Class DataInput
- java.lang.Object
-
- java.io.InputStream
-
- org.basex.io.in.BufferInput
-
- org.basex.io.in.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'sDataInputStream
.- Author:
- BaseX Team 2005-24, BSD License, Christian Gruen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
readBool()
Reads a boolean value.IntList
readDiffs()
Reads a distance-mapped integer array.double
readDouble()
Reads a double value.long
readLong()
Reads a long value.long[]
readLongs(int s)
Reads an array of long values.int
readNum()
Reads a compressed integer value; seeNum
for more.int[]
readNums()
Reads a compressed integer array.byte[]
readToken()
Reads a token, represented by its compressed length and its byte array.byte[][]
readTokens()
Reads a token array.-
Methods inherited from class org.basex.io.in.BufferInput
close, content, get, get, io, length, mark, markSupported, read, readByte, readBytes, readString, reset, size
-
Methods inherited from class java.io.InputStream
available, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skip, transferTo
-
-
-
-
Constructor Detail
-
DataInput
public DataInput(IO io) throws IOException
Constructor.- Parameters:
io
- the input to be read- Throws:
IOException
- I/O Exception
-
-
Method Detail
-
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; seeNum
for more.- Returns:
- read value
- Throws:
IOException
- I/O Exception
-
readLong
public long readLong() throws IOException
Reads a long value.- 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
-
-