A general purpose reader of data from avro streams. This can optionally resolve if the reader's and writer's schemas are different. This class is a wrapper around DefaultReader and offers a little more type safety. The default reader has the flexibility to return any type of object for each read call because the Read() method is generic. This class on the other hand can only return a single type because the type is a parameter to the class. Any user defined extension should, however, be done to DefaultReader. This class is sealed.
More...
List of all members.
Public Member Functions |
| GenericReader (Schema writerSchema, Schema readerSchema) |
| Constructs a generic reader for the given schemas using the DefaultReader. If the reader's and writer's schemas are different this class performs the resolution.
|
| GenericReader (DefaultReader reader) |
| Constructs a generic reader by directly using the given DefaultReader.
|
T | Read (T reuse, Decoder d) |
| Read a datum. Traverse the schema, depth-first, reading all leaf values in the schema into a datum that is returned. If the provided datum is non-null it may be reused and returned.
|
Properties |
Schema | WriterSchema [get] |
Schema | ReaderSchema [get] |
Detailed Description
template<T>
class Avro::Generic::GenericReader< T >
A general purpose reader of data from avro streams. This can optionally resolve if the reader's and writer's schemas are different. This class is a wrapper around DefaultReader and offers a little more type safety. The default reader has the flexibility to return any type of object for each read call because the Read() method is generic. This class on the other hand can only return a single type because the type is a parameter to the class. Any user defined extension should, however, be done to DefaultReader. This class is sealed.
- Template Parameters:
-
Member Function Documentation
Constructs a generic reader for the given schemas using the DefaultReader. If the reader's and writer's schemas are different this class performs the resolution.
- Parameters:
-
writerSchema | The schema used while generating the data |
readerSchema | The schema desired by the reader |
Constructs a generic reader by directly using the given DefaultReader.
- Parameters:
-
reader | The actual reader to use |
Read a datum. Traverse the schema, depth-first, reading all leaf values in the schema into a datum that is returned. If the provided datum is non-null it may be reused and returned.
Implements Avro.Generic.DatumReader< T >.
The documentation for this class was generated from the following file:
- src/apache/main/Generic/GenericReader.cs