Avro C#
Public Member Functions | Properties | List of all members
Avro.File.IFileReader< T > Interface Template Reference

Defines the interface for an object that reads data from a file. More...

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

Public Member Functions

Header GetHeader ()
 Return the header for the input file or stream. More...
 
Schema GetSchema ()
 Return the schema as read from the file or stream. More...
 
ICollection< string > GetMetaKeys ()
 Return the list of keys in the metadata. More...
 
Next ()
 Read the next datum from the file. More...
 
bool HasNext ()
 Returns true if more entries remain in this file. More...
 
byte[] GetMeta (string key)
 Return the byte value of a metadata property. More...
 
long GetMetaLong (string key)
 Return the long value of a metadata property. More...
 
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. More...
 
bool PastSync (long position)
 Return true if past the next synchronization point after a position. More...
 
long PreviousSync ()
 Return the last synchronization point before our current position. More...
 
void Seek (long position)
 Move to a specific, known synchronization point, one returned from IFileWriter<T>.Sync while writing. More...
 
void Sync (long position)
 Move to the next synchronization point after a position. More...
 
long Tell ()
 Return the current position in the input. More...
 

Properties

IEnumerable< T > NextEntries [get]
 Return an enumeration of the remaining entries in the file. More...
 

Detailed Description

Defines the interface for an object that reads data from a file.

Template Parameters
TType to serialize data to.

Member Function Documentation

◆ GetHeader()

Header Avro.File.IFileReader< T >.GetHeader ( )

Return the header for the input file or stream.

Returns
Parsed header from the file or stream.

Implemented in Avro.File.DataFileReader< T >.

◆ GetMeta()

byte [] Avro.File.IFileReader< T >.GetMeta ( string  key)

Return the byte value of a metadata property.

Parameters
keyKey for the metadata entry.
Returns
Raw bytes of the value of the metadata entry.
Exceptions
KeyNotFoundExceptionThere is no metadata entry with the specified key .

Implemented in Avro.File.DataFileReader< T >.

◆ GetMetaKeys()

ICollection<string> Avro.File.IFileReader< T >.GetMetaKeys ( )

Return the list of keys in the metadata.

Returns
Metadata keys from the header of the data file.

Implemented in Avro.File.DataFileReader< T >.

◆ GetMetaLong()

long Avro.File.IFileReader< T >.GetMetaLong ( string  key)

Return the long value of a metadata property.

Parameters
keyKey for the metadata entry.
Returns
Metadata value as a long.
Exceptions
KeyNotFoundExceptionThere is no metadata entry with the specified key .

Implemented in Avro.File.DataFileReader< T >.

◆ GetMetaString()

string Avro.File.IFileReader< T >.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.

Parameters
keyKey for the metadata entry.
Returns
Metadata value as a string.
Exceptions
KeyNotFoundExceptionThere is no metadata entry with the specified key .
AvroRuntimeExceptionEncountered an exception while decoding the value as a UTF-8 string.

Implemented in Avro.File.DataFileReader< T >.

◆ GetSchema()

Schema Avro.File.IFileReader< T >.GetSchema ( )

Return the schema as read from the file or stream.

Returns
Parse schema from the file or stream.

Implemented in Avro.File.DataFileReader< T >.

◆ HasNext()

bool Avro.File.IFileReader< T >.HasNext ( )

Returns true if more entries remain in this file.

Returns
True if more entries remain in this file, false otherwise.

Implemented in Avro.File.DataFileReader< T >.

◆ Next()

T Avro.File.IFileReader< T >.Next ( )

Read the next datum from the file.

Returns
Next deserialized data entry.

Implemented in Avro.File.DataFileReader< T >.

◆ PastSync()

bool Avro.File.IFileReader< T >.PastSync ( long  position)

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

Parameters
positionPosition to test.
Returns
True if path the next synchronization point after position , false otherwise.

Implemented in Avro.File.DataFileReader< T >.

◆ PreviousSync()

long Avro.File.IFileReader< T >.PreviousSync ( )

Return the last synchronization point before our current position.

Returns
Position of the last synchronization point before our current position.

Implemented in Avro.File.DataFileReader< T >.

◆ Seek()

void Avro.File.IFileReader< T >.Seek ( long  position)

Move to a specific, known synchronization point, one returned from IFileWriter<T>.Sync while writing.

Parameters
positionPosition to jump to.

Implemented in Avro.File.DataFileReader< T >.

◆ Sync()

void Avro.File.IFileReader< T >.Sync ( long  position)

Move to the next synchronization point after a position.

Parameters
positionPosition in the stream to start.

Implemented in Avro.File.DataFileReader< T >.

◆ Tell()

long Avro.File.IFileReader< T >.Tell ( )

Return the current position in the input.

Returns
Current position in the input.

Implemented in Avro.File.DataFileReader< T >.

Property Documentation

◆ NextEntries

IEnumerable<T> Avro.File.IFileReader< T >.NextEntries
get

Return an enumeration of the remaining entries in the file.

Returns
An enumeration of the remaining entries in the file.

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