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.ReaderThis 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 classDataReader.FastEOFExceptionConstructing 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.InputStreamin
-
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 voidclose()intread(char[] buff, int off, int len)bytereadByte()Read a byte.private charreadChar()Read one character from the input stream.intreadVarInt()Read a variable size integer.
-
-
-
Method Detail
-
readByte
public byte readByte() throws java.io.IOExceptionRead a byte.- Returns:
- the byte
- Throws:
java.io.IOException- on failure
-
readVarInt
public int readVarInt() throws java.io.IOExceptionRead a variable size integer.- Returns:
- the value
- Throws:
java.io.IOException- on failure
-
readChar
private char readChar() throws java.io.IOExceptionRead one character from the input stream.- Returns:
- the character
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Reader- Throws:
java.io.IOException
-
read
public int read(char[] buff, int off, int len) throws java.io.IOException- Specified by:
readin classjava.io.Reader- Throws:
java.io.IOException
-
-