Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # dev >> Tracking the current position of stream decoded BinaryDecoder


Copy link to this message
-
Re: Tracking the current position of stream decoded BinaryDecoder
On Wed, Oct 16, 2013 at 10:25 AM, Youssef Hatem
<[EMAIL PROTECTED]> wrote:
> BinaryDecoder offers getPos() to get the current position which I assume should correspond to the progress the BinaryDecoder has made decoding the passed stream.

That is not a public method in BinaryDecoder, but rather a private
method that refers only to the position with a private buffer.  If you
need to know the number of bytes consumed you may use a direct binary
decoder and pass in an input stream which tracks its position (e.g.,
FileInputStream or RandomAccessFile).

http://avro.apache.org/docs/current/api/java/org/apache/avro/io/DecoderFactory.html#directBinaryDecoder(java.io.InputStream,
org.apache.avro.io.BinaryDecoder)

Doug
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB