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`

public abstract class ParsingEncoder extends Encoder
Base class for parser-based `Encoder`s.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`pos`

## Constructor Summary

Constructors
Constructor
Description
`ParsingEncoder()`

## Method Summary

Modifier and Type
Method
Description
`protected 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`
`startItem()`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.io.Flushable

`flush`

## Field Details

### pos

protected int pos

## Constructor Details

### ParsingEncoder

public ParsingEncoder()

## Method Details

### setItemCount

public void setItemCount(long itemCount) throws IOException
Description copied from class: `Encoder`
Call this method before writing a batch of items in an array or a map. Then for each item, call `Encoder.startItem()` followed by any of the other write methods of `Encoder`. The number of calls to `Encoder.startItem()` must be equal to the count specified in `Encoder.setItemCount(long)`. Once a batch is completed you can start another batch with `Encoder.setItemCount(long)`.

Specified by:
  `setItemCount` in class `Encoder`
Parameters:
  `itemCount` - The number of `Encoder.startItem()` calls to follow.
Throws:
  `IOException`

### startItem

public void startItem() throws IOException
Description copied from class: `Encoder`
Start a new item of an array or map. See `Encoder.writeArrayStart()` for usage information.

Specified by:
  `startItem` in class `Encoder`
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()