Avro C#

Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
Avro.File.DataFileReader< T > Class Template Reference

Provides access to Avro data written using the DataFileWriter<T>. More...

Inheritance diagram for Avro.File.DataFileReader< T >:

## Public Member Functions
delegate DatumReader< T > | CreateDatumReader (Schema writerSchema, Schema readerSchema)
| Defines the signature for a function that returns a new DatumReader<T> given a writer and reader schema. More...
Header | GetHeader ()
| Return the header for the input file or stream.
Schema | GetSchema ()
| Return the schema as read from the file or stream.
ICollection< string > | GetMetaKeys ()
| Return the list of keys in the metadata.
byte[] | GetMeta (string key)
| Return the byte value of a metadata property.
long | GetMetaLong (string key)
| Return the long value of a metadata property.
string | GetMetaString (string key)
| Return the string value of a metadata property. This method assumes that the string is a UTF-8 encoded in the header.
void | Seek (long position)
| Move to a specific, known synchronization point, one returned from IFileWriter<T>.Sync while writing.
void | Sync (long position)
| Move to the next synchronization point after a position.
bool | PastSync (long position)
| Return true if past the next synchronization point after a position.
long | PreviousSync ()
| Return the last synchronization point before our current position.
long | Tell ()
| Return the current position in the input.
bool | HasNext ()
| Returns true if more entries remain in this file.
void | Reset ()
| Resets this reader. More...
void | Dispose ()
T | Next ()
| Read the next datum from the file.

## Static Public Member Functions
static IFileReader< T > | OpenReader (string path)
| Open a reader for a file using path. More...
static IFileReader< T > | OpenReader (string path, Schema readerSchema)
| Open a reader for a file using path and the reader's schema. More...
static IFileReader< T > | OpenReader (Stream inStream)
| Open a reader for a stream. More...
static IFileReader< T > | OpenReader (Stream inStream, bool leaveOpen)
| Open a reader for a stream. More...
static IFileReader< T > | OpenReader (Stream inStream, Schema readerSchema)
| Open a reader for a stream using the reader's schema. More...
static IFileReader< T > | OpenReader (Stream inStream, Schema readerSchema, bool leaveOpen)
| Open a reader for a stream using the reader's schema. More...
static IFileReader< T > | OpenReader (Stream inStream, Schema readerSchema, CreateDatumReader datumReaderFactory)
| Open a reader for a stream using the reader's schema and a custom DatumReader. More...
static IFileReader< T > | OpenReader (Stream inStream, Schema readerSchema, CreateDatumReader datumReaderFactory, bool leaveOpen)
| Open a reader for a stream using the reader's schema and a custom DatumReader. More...

## Protected Member Functions
virtual void | Dispose (bool disposing)
| Releases resources associated with this DataFileReader<T>. More...

## Properties
IEnumerable< T > | NextEntries`[get]`
Properties inherited from Avro.File.IFileReader< T >
IEnumerable< T > | NextEntries`[get]`
| Return an enumeration of the remaining entries in the file. More...

## Detailed Description

Provides access to Avro data written using the DataFileWriter<T>.

Template Parameters

  T | Type to deserialze data objects to.

See also
  IFileReader<T>

## Member Function Documentation

## ◆ CreateDatumReader()

delegate DatumReader<T> Avro.File.DataFileReader< T >.CreateDatumReader | ( | Schema | writerSchema,
|  | Schema | readerSchema
| ) |  |

Defines the signature for a function that returns a new DatumReader<T> given a writer and reader schema.

Parameters

  writerSchema | Schema used to write the datum.
  readerSchema | Schema used to read the datum.

Returns
  A datum reader.

## ◆ Dispose()

virtual void Avro.File.DataFileReader< T >.Dispose | ( | bool | disposing | ) |
| inline protected virtual

Releases resources associated with this DataFileReader<T>.

Parameters

  disposing | True if called from Dispose(); false otherwise.

## ◆ OpenReader() [1/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream | ) |
| inline static

Open a reader for a stream.

Parameters

  inStream | The in stream.

Returns
  File Reader.

## ◆ OpenReader() [2/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream,
|  | bool | leaveOpen
| ) |  |
| inline static

Open a reader for a stream.

Parameters

  inStream | The in stream.
  leaveOpen | Leave the stream open after disposing the object.

Returns
  File Reader.

## ◆ OpenReader() [3/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream,
|  | Schema | readerSchema
| ) |  |
| inline static

Open a reader for a stream using the reader's schema.

Parameters

  inStream | Stream containing the file contents.
  readerSchema | Schema used to read the file.

Returns
  A new file reader.

## ◆ OpenReader() [4/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream,
|  | Schema | readerSchema,
|  | bool | leaveOpen
| ) |  |
| inline static

Open a reader for a stream using the reader's schema.

Parameters

  inStream | Stream containing the file contents.
  readerSchema | Schema used to read the file.
  leaveOpen | Leave the stream open after disposing the object.

Returns
  A new file reader.

## ◆ OpenReader() [5/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream,
|  | Schema | readerSchema,
|  | CreateDatumReader | datumReaderFactory
| ) |  |
| inline static

Open a reader for a stream using the reader's schema and a custom DatumReader.

Parameters

  inStream | Stream of file contents.
  readerSchema | Schema used to read the file.
  datumReaderFactory | Factory to create datum readers given a reader an writer schema.

Returns
  A new file reader.

## ◆ OpenReader() [6/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | Stream | inStream,
|  | Schema | readerSchema,
|  | CreateDatumReader | datumReaderFactory,
|  | bool | leaveOpen
| ) |  |
| inline static

Open a reader for a stream using the reader's schema and a custom DatumReader.

Parameters

  inStream | Stream of file contents.
  readerSchema | Schema used to read the file.
  datumReaderFactory | Factory to create datum readers given a reader an writer schema.
  leaveOpen | Leave the stream open after disposing the object.

Returns
  A new file reader.

## ◆ OpenReader() [7/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | string | path | ) |
| inline static

Open a reader for a file using path.

Parameters

  path | The path.

Returns
  File Reader.

## ◆ OpenReader() [8/8]

static IFileReader<T> Avro.File.DataFileReader< T >.OpenReader | ( | string | path,
|  | Schema | readerSchema
| ) |  |
| inline static

Open a reader for a file using path and the reader's schema.

Parameters

  path | Path to the file.
  readerSchema | Schema used to read data from the file.

Returns
  A new file reader.

## ◆ Reset()

void Avro.File.DataFileReader< T >.Reset | ( |  | ) |
| inline

Resets this reader.

The documentation for this class was generated from the following file:

- src/apache/main/File/DataFileReader.cs