avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fengyun RAO <raofeng...@gmail.com>
Subject How to deserialize java resource file in the jar package?
Date Wed, 30 Apr 2014 05:43:58 GMT
In C# version, there is an API:
 IFileReader<T> OpenReader(Stream inStream)
which require only a "Stream" object.

However in java version, it requires a "SeekableInput":
FileReader<D> openReader(SeekableInput in, DatumReader<D> reader)

Now that the data is in the resource file which is embedded in the jar
we can only get a stream using getResourceAsStream() method,
how can we deserialize the data?

I also wonder why are the APIs different between C# and java version.
Could there also be an API requiring only a Stream object in java, which I
would be quite convenient.

View raw message