## org.apache.hadoop.io
Class ArrayFile.Reader

    java.lang.Object
      org.apache.hadoop.io.MapFile.Reader
          org.apache.hadoop.io.ArrayFile.Reader

All Implemented Interfaces:
  Closeable

Enclosing class:
  ArrayFile

    public static class ArrayFile.Reader

extends MapFile.Reader

Provide access to an existing array file.

Constructor Summary
`ArrayFile.Reader(FileSystem fs, String file, Configuration conf)` Construct an array reader for the named file.

Method Summary
`Writable` `get(long n, Writable value)` Return the `n`th value in the file.
`long` `key()` Returns the key associated with the most recent call to `seek(long)`, `next(Writable)`, or `get(long,Writable)`.
`Writable` `next(Writable value)` Read and return the next value in the file.
`void` `seek(long n)` Positions the reader before its `n`th value.

Methods inherited from class org.apache.hadoop.io.MapFile.Reader
`close, createDataFileReader, finalKey, get, getClosest, getClosest, getKeyClass, getValueClass, midKey, next, open, reset, seek`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ArrayFile.Reader

    public ArrayFile.Reader(FileSystem fs,
                            String file,
                            Configuration conf)
                     throws IOException

  Construct an array reader for the named file.

  Throws:
    `IOException`

Method Detail

### seek

    public void seek(long n)
              throws IOException

  Positions the reader before its `n`th value.

  Throws:
    `IOException`

### next

    public Writable next(Writable value)
                  throws IOException

  Read and return the next value in the file.

  Throws:
    `IOException`

### key

    public long key()
             throws IOException

  Returns the key associated with the most recent call to `seek(long)`, `next(Writable)`, or `get(long,Writable)`.

  Throws:
    `IOException`

### get

    public Writable get(long n,
                        Writable value)
                 throws IOException

  Return the `n`th value in the file.

  Throws:
    `IOException`

Copyright © 2009 The Apache Software Foundation