# Class RandomAccessFileReader

java.lang.Object
java.io.Reader
org.apache.zookeeper.graph.RandomAccessFileReader

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

public class RandomAccessFileReader extends Reader implements DataInput

## Field Summary

### Fields inherited from class Reader

`lock`

## Constructor Summary

Constructors
Constructor
Description
`RandomAccessFileReader(File f)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`long`
`getPosition()`
Seek interface
`static void`
`main(String[] args)`
`boolean`
`markSupported()`
Reader interface
`int`
`read(byte[] buf, int off, int len)`
`int`
`read(char[] cbuf, int off, int len)`
copy what we can from buffer.
`boolean`
`readBoolean()`
`byte`
`readByte()`
`char`
`readChar()`
`double`
`readDouble()`
`float`
`readFloat()`
`void`
`readFully(byte[] b)`
DataInput interface
`void`
`readFully(byte[] b, int off, int len)`
`int`
`readInt()`
`String`
`readLine()`
works like the usual readLine but disregards \r to make things easier
`long`
`readLong()`
`short`
`readShort()`
`int`
`readUnsignedByte()`
`int`
`readUnsignedShort()`
`String`
`readUTF()`
`void`
`seek(long pos)`
`int`
`skipBytes(int n)`

### Methods inherited from class Reader

`mark, read, read, read, ready, reset, skip`

### Methods inherited from class Object

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

## Constructor Details

### RandomAccessFileReader

public RandomAccessFileReader(File f) throws FileNotFoundException

Throws:
  `FileNotFoundException`

## Method Details

### markSupported

public boolean markSupported()
Reader interface

Overrides:
  `markSupported` in class `Reader`

### read

public int read(char[] cbuf, int off, int len) throws IOException
copy what we can from buffer. if it's not enough, fill buffer again and copy again

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

### read

public int read(byte[] buf, int off, int len) throws IOException

Throws:
  `IOException`

### 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`

### getPosition

public long getPosition()
Seek interface

### seek

public void seek(long pos) throws IOException

Throws:
  `IOException`

### readLine

public String readLine() throws IOException
works like the usual readLine but disregards \r to make things easier

Specified by:
  `readLine` in interface `DataInput`
Throws:
  `IOException`

### readFully

public void readFully(byte[] b) throws IOException
DataInput interface

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

### readFully

public void readFully(byte[] b, int off, int len) throws IOException

Specified by:
  `readFully` in interface `DataInput`
Throws:
  `IOException`

### skipBytes

public int skipBytes(int n) throws IOException

Specified by:
  `skipBytes` in interface `DataInput`
Throws:
  `IOException`

### readBoolean

public boolean readBoolean() throws IOException

Specified by:
  `readBoolean` in interface `DataInput`
Throws:
  `IOException`

### readByte

public byte readByte() throws IOException

Specified by:
  `readByte` in interface `DataInput`
Throws:
  `IOException`

### readUnsignedByte

public int readUnsignedByte() throws IOException

Specified by:
  `readUnsignedByte` in interface `DataInput`
Throws:
  `IOException`

### readShort

public short readShort() throws IOException

Specified by:
  `readShort` in interface `DataInput`
Throws:
  `IOException`

### readUnsignedShort

public int readUnsignedShort() throws IOException

Specified by:
  `readUnsignedShort` in interface `DataInput`
Throws:
  `IOException`

### readChar

public char readChar() throws IOException

Specified by:
  `readChar` in interface `DataInput`
Throws:
  `IOException`

### readInt

public int readInt() throws IOException

Specified by:
  `readInt` in interface `DataInput`
Throws:
  `IOException`

### readLong

public long readLong() throws IOException

Specified by:
  `readLong` in interface `DataInput`
Throws:
  `IOException`

### readFloat

public float readFloat() throws IOException

Specified by:
  `readFloat` in interface `DataInput`
Throws:
  `IOException`

### readDouble

public double readDouble() throws IOException

Specified by:
  `readDouble` in interface `DataInput`
Throws:
  `IOException`

### readUTF

public String readUTF() throws IOException

Specified by:
  `readUTF` in interface `DataInput`
Throws:
  `IOException`

### main

public static void main(String[] args) throws IOException

Throws:
  `IOException`