Package org.h2.store

# Class DataReader

java.lang.Object
java.io.Reader
org.h2.store.DataReader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Readable`

public class DataReader extends Reader
This class is backed by an input stream and supports reading values and variable size data.

## Field Summary

### Fields inherited from class java.io.Reader

`lock`

## Constructor Summary

Constructors
Constructor
Description
`DataReader(InputStream in)`
Create a new data reader.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`int`
`read(char[] buff, int off, int len)`
`byte`
`readByte()`
Read a byte.
`int`
`readVarInt()`
Read a variable size integer.

### Methods inherited from class java.io.Reader

`mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DataReader

public DataReader(InputStream in)
Create a new data reader.

Parameters:
  `in` - the input stream

## Method Details

### readByte

public byte readByte() throws IOException
Read a byte.

Returns:
  the byte
Throws:
  `IOException` - on failure

### readVarInt

public int readVarInt() throws IOException
Read a variable size integer.

Returns:
  the value
Throws:
  `IOException` - on failure

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in class `Reader`
Throws:
  `IOException`

### read

public int read(char[] buff, int off, int len) throws IOException

Specified by:
  `read` in class `Reader`
Throws:
  `IOException`