Package org.h2.store
Class DataReader
- java.lang.Object
-
- java.io.Reader
-
- org.h2.store.DataReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class DataReader extends java.io.Reader
This class is backed by an input stream and supports reading values and variable size data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
DataReader.FastEOFException
Constructing such an EOF exception is fast, because the stack trace is not filled in.
-
Field Summary
Fields Modifier and Type Field Description private java.io.InputStream
in
-
Constructor Summary
Constructors Constructor Description DataReader(java.io.InputStream in)
Create a new data reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
read(char[] buff, int off, int len)
byte
readByte()
Read a byte.private char
readChar()
Read one character from the input stream.int
readVarInt()
Read a variable size integer.
-
-
-
Method Detail
-
readByte
public byte readByte() throws java.io.IOException
Read a byte.- Returns:
- the byte
- Throws:
java.io.IOException
- on failure
-
readVarInt
public int readVarInt() throws java.io.IOException
Read a variable size integer.- Returns:
- the value
- Throws:
java.io.IOException
- on failure
-
readChar
private char readChar() throws java.io.IOException
Read one character from the input stream.- Returns:
- the character
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Reader
- Throws:
java.io.IOException
-
read
public int read(char[] buff, int off, int len) throws java.io.IOException
- Specified by:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
-