org.apache.avro.file
Class DataFileReader<D>

java.lang.Object
  extended by org.apache.avro.file.DataFileReader<D>

public class DataFileReader<D>
extends Object

Read files written by DataFileWriter.

See Also:
DataFileWriter

Constructor Summary
DataFileReader(SeekableInput sin, DatumReader<D> reader)
          Construct a reader for a file.
 
Method Summary
 void close()
          Close this reader.
 byte[] getMeta(String key)
          Return the value of a metadata property.
 long getMetaLong(String key)
          Return the value of a metadata property.
 String getMetaString(String key)
          Return the value of a metadata property.
 D next(D reuse)
          Return the next datum in the file.
 void seek(long position)
          Move to the specified synchronization point, as returned by DataFileWriter.sync().
 void sync(long position)
          Move to the next synchronization point after a position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFileReader

public DataFileReader(SeekableInput sin,
                      DatumReader<D> reader)
               throws IOException
Construct a reader for a file.

Throws:
IOException
Method Detail

getMeta

public byte[] getMeta(String key)
Return the value of a metadata property.


getMetaString

public String getMetaString(String key)
Return the value of a metadata property.


getMetaLong

public long getMetaLong(String key)
Return the value of a metadata property.


next

public D next(D reuse)
       throws IOException
Return the next datum in the file.

Throws:
IOException

seek

public void seek(long position)
          throws IOException
Move to the specified synchronization point, as returned by DataFileWriter.sync().

Throws:
IOException

sync

public void sync(long position)
          throws IOException
Move to the next synchronization point after a position.

Throws:
IOException

close

public void close()
           throws IOException
Close this reader.

Throws:
IOException


Copyright © 2009 The Apache Software Foundation