Details
Description
When calling the method DataFileReader.OpenReader on a non-seekable stream, the method throws an AvroException.
The requirements for this Seek() call is:
- To ensure the magic number to be there and rewind the Stream afterward.
- To be able to call the methods Seek and Sync.
The 1. is not useful as the Ctor does ensure again that the magic number is there (this is the reason why the Stream has to be rewind). This code can just be removed with no side effect, as a Stream without this magic number will throw itself an AvroException. (the message being "Not a valid data file!" instead of "Not an Avro data file").
The 2. could be checked at the call time of the method: the user that sends a non-seekable Stream should not call Seek or Sync upon the reader. (and by the way the Stream should throws a UnsupportedException at this time)
Attachments
Issue Links
- is duplicated by
-
AVRO-2098 Avro OCF support for non-seekable stream.
- Resolved
- links to