Package org.apache.avro.io
Class ParsingEncoder
java.lang.Object
org.apache.avro.io.Encoder
org.apache.avro.io.ParsingEncoder
- All Implemented Interfaces:
Flushable
- Direct Known Subclasses:
JsonEncoder
,ValidatingEncoder
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final int
depth()
protected final void
pop()
protected final void
push()
Push a new collection on to the stack.void
setItemCount
(long itemCount) Call this method before writing a batch of items in an array or a map.void
Start a new item of an array or map.Methods inherited from class org.apache.avro.io.Encoder
writeArrayEnd, writeArrayStart, writeBoolean, writeBytes, writeBytes, writeBytes, writeDouble, writeEnum, writeFixed, writeFixed, writeFixed, writeFloat, writeIndex, writeInt, writeLong, writeMapEnd, writeMapStart, writeNull, writeString, writeString, writeString
-
Field Details
-
pos
protected int pos
-
-
Constructor Details
-
ParsingEncoder
public ParsingEncoder()
-
-
Method Details
-
setItemCount
Description copied from class:Encoder
Call this method before writing a batch of items in an array or a map. Then for each item, callEncoder.startItem()
followed by any of the other write methods ofEncoder
. The number of calls toEncoder.startItem()
must be equal to the count specified inEncoder.setItemCount(long)
. Once a batch is completed you can start another batch withEncoder.setItemCount(long)
.- Specified by:
setItemCount
in classEncoder
- Parameters:
itemCount
- The number ofEncoder.startItem()
calls to follow.- Throws:
IOException
-
startItem
Description copied from class:Encoder
Start a new item of an array or map. SeeEncoder.writeArrayStart()
for usage information.- Specified by:
startItem
in classEncoder
- Throws:
IOException
-
push
protected final void push()Push a new collection on to the stack. -
pop
protected final void pop() -
depth
protected final int depth()
-