Top Description Methods
org.apache.avro.file

public Interface FileReader<D>

extends Iterator<D>, Iterable<D>, Closeable
Known Direct Implementers
org.apache.avro.file.DataFileReader, org.apache.avro.file.DataFileReader12
Imports
java.io.IOException, .Closeable, java.util.Iterator, .NoSuchElementException, org.apache.avro.Schema

Interface for reading data from a file.

Method Summary

Modifier and TypeMethod and Description
public Schema
getSchema()

Return the schema for data in this file.

public D
next(D
an instance to reuse.
reuse
)

Read the next datum from the file.

public boolean
pastSync(long position)

Return true if past the next synchronization point after a position.

public void
sync(long position)

Move to the next synchronization point after a position.

public long
tell()

Return the current position in the input.

Inherited from java.io.Closeable:
close
Inherited from java.lang.Iterable:
forEachiteratorspliterator
Inherited from java.util.Iterator:
forEachRemaininghasNextnextremove

Method Detail

getSchemaback to summary
public Schema getSchema()

Return the schema for data in this file.

nextback to summary
public D next(D reuse) throws IOException

Read the next datum from the file.

Parameters
reuse:D

an instance to reuse.

Exceptions
NoSuchElementException:
if no more remain in the file.
pastSyncback to summary
public boolean pastSync(long position) throws IOException

Return true if past the next synchronization point after a position.

syncback to summary
public void sync(long position) throws IOException

Move to the next synchronization point after a position. To process a range of file entires, call this with the starting position, then check pastSync(long) with the end point before each call to next().

tellback to summary
public long tell() throws IOException

Return the current position in the input.