| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | BufferConfiguration.
the type of BufferConfiguration. Configuration extends BufferConfigurationthe type of Builder that builds BufferConfiguration subclasses of type `Configuration`. BuilderType extends BufferConfiguration.Provides logic common to all BufferConfiguration Builder implementations. |
| public static interface | BufferConfiguration.
Functional interface for reporting processed data. |
| public static interface | BufferConfiguration.
Functional interface for handling oversized values. |
| Modifier and Type | Field and Description |
|---|---|
| private final BufferConfiguration. | dataHandler
The handler that will be notified when data is processed. |
| private final int | initialBufferSize
The initial size of the buffer, in bytes. |
| private final int | maximumBufferSize
The maximum number of bytes that may be buffered. |
| private final BufferConfiguration. | oversizedValueHandler
The handler that will be notified when oversized values are encountered. |
| Access | Constructor and Description |
|---|---|
| protected | BufferConfiguration(BufferConfiguration.
the builder containing the settings to apply to the new configuration. builderConstructs an instance from the given Builder. |
| Modifier and Type | Method and Description |
|---|---|
| public final BufferConfiguration. | |
| public final int | |
| public final int | |
| public final BufferConfiguration. | Returns: the handler that will be notified when oversized values are encountered.
|
| protected void |
| dataHandler | back to summary |
|---|---|
| private final BufferConfiguration. The handler that will be notified when data is processed. | |
| initialBufferSize | back to summary |
|---|---|
| private final int initialBufferSize The initial size of the buffer, in bytes. | |
| maximumBufferSize | back to summary |
|---|---|
| private final int maximumBufferSize The maximum number of bytes that may be buffered. | |
| oversizedValueHandler | back to summary |
|---|---|
| private final BufferConfiguration. The handler that will be notified when oversized values are encountered. | |
| BufferConfiguration | back to summary |
|---|---|
| protected BufferConfiguration(BufferConfiguration. Constructs an instance from the given Builder.
| |
| getDataHandler | back to summary |
|---|---|
public final BufferConfiguration.
| |
| getInitialBufferSize | back to summary |
|---|---|
public final int getInitialBufferSize()
| |
| getMaximumBufferSize | back to summary |
|---|---|
public final int getMaximumBufferSize()
| |
| getOversizedValueHandler | back to summary |
|---|---|
public final BufferConfiguration.
| |
| requireMaximumBufferSize | back to summary |
|---|---|
| protected void requireMaximumBufferSize() Requires that the maximum buffer size not be limited. | |
| Modifier and Type | Field and Description |
|---|---|
| private BufferConfiguration. | dataHandler
The handler that will be notified when data is processed. |
| pack-priv static final int | DEFAULT_INITIAL_BUFFER_SIZE
Large enough that most streams will never need to grow the buffer. |
| private int | initialBufferSize
The initial size of the lookahead buffer, in bytes. |
| private int | maximumBufferSize
The maximum number of bytes that will be buffered. |
| private BufferConfiguration. | oversizedValueHandler
The handler that will be notified when oversized values are encountered. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Configuration | Returns: a new instance.Creates a new BufferConfiguration from the Builder's current settings. |
| public final BufferConfiguration. | |
| public final int | |
| public int | |
| public abstract int | |
| public abstract BufferConfiguration. | Returns: the no-opDataHandler for the type of BufferConfiguration that this Builder builds.
|
| public abstract BufferConfiguration. | Returns: the no-opOversizedValueHandler for the type of BufferConfiguration that this Builder builds.
|
| public final BufferConfiguration. | Returns: the handler that will be notified when oversized values are encountered.
|
| public abstract BufferConfiguration. | Returns: anOversizedValueHandler that always throws a runtime exception.
|
| public final BuilderType | Returns: this builder.the handler. handlerSets the handler that will be notified when data is processed. |
| public final BuilderType | Returns: this builder.the handler. handlerSets the handler that will be notified when oversized values are encountered. |
| public final BuilderType | Returns: this Builder.the value. initialBufferSizeInBytes)Sets the initial size of the buffer that will be used to hold the data between top-level values. |
| public final BuilderType | Returns: this builder.the value. maximumBufferSizeInBytes)Set the maximum size of the buffer. |
| dataHandler | back to summary |
|---|---|
| private BufferConfiguration. The handler that will be notified when data is processed. | |
| DEFAULT_INITIAL_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_INITIAL_BUFFER_SIZE Large enough that most streams will never need to grow the buffer. Note this only needs to be large enough to exceed the length of the longest top-level value plus any system values that precede it. | |
| initialBufferSize | back to summary |
|---|---|
| private int initialBufferSize The initial size of the lookahead buffer, in bytes. | |
| maximumBufferSize | back to summary |
|---|---|
| private int maximumBufferSize The maximum number of bytes that will be buffered. | |
| oversizedValueHandler | back to summary |
|---|---|
| private BufferConfiguration. The handler that will be notified when oversized values are encountered. | |
| Builder | back to summary |
|---|---|
| public Builder() | |
| build | back to summary |
|---|---|
| public abstract Configuration build() Creates a new BufferConfiguration from the Builder's current settings.
| |
| getDataHandler | back to summary |
|---|---|
public final BufferConfiguration.
| |
| getInitialBufferSize | back to summary |
|---|---|
public final int getInitialBufferSize()
| |
| getMaximumBufferSize | back to summary |
|---|---|
public int getMaximumBufferSize()
| |
| getMinimumMaximumBufferSize | back to summary |
|---|---|
| public abstract int getMinimumMaximumBufferSize() Gets the minimum allowed maximum buffer size.
| |
| getNoOpDataHandler | back to summary |
|---|---|
public abstract BufferConfiguration.
| |
| getNoOpOversizedValueHandler | back to summary |
|---|---|
public abstract BufferConfiguration.
| |
| getOversizedValueHandler | back to summary |
|---|---|
public final BufferConfiguration.
| |
| getThrowingOversizedValueHandler | back to summary |
|---|---|
public abstract BufferConfiguration.
| |
| onData | back to summary |
|---|---|
| public final BuilderType onData(final BufferConfiguration. Sets the handler that will be notified when data is processed. The handler may be null, in which case the number of bytes processed will not be reported.
| |
| onOversizedValue | back to summary |
|---|---|
| public final BuilderType onOversizedValue(final BufferConfiguration. Sets the handler that will be notified when oversized values are encountered. If the maximum buffer size is
finite (see
| |
| withInitialBufferSize | back to summary |
|---|---|
| public final BuilderType withInitialBufferSize(final int initialBufferSizeInBytes) Sets the initial size of the buffer that will be used to hold the data between top-level values. Default: 32KB.
| |
| withMaximumBufferSize | back to summary |
|---|---|
| public final BuilderType withMaximumBufferSize(final int maximumBufferSizeInBytes) Set the maximum size of the buffer. For binary Ion, the minimum value is 5 because all valid binary Ion data begins with a 4-byte Ion version marker and the smallest value is 1 byte. For text Ion, the minimum value is 2 because the smallest text Ion value is 1 byte and the smallest delimiter is 1 byte. Default: Near to the maximum size of an array.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | onData(int
the number of bytes processed. numberOfBytes)Invoked whenever the bytes from a value are processed, regardless of whether the bytes are buffered or skipped due to the value being oversized. |
| onData | back to summary |
|---|---|
| public void onData(int numberOfBytes) Invoked whenever the bytes from a value are processed, regardless of whether the bytes are buffered or skipped due to the value being oversized.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| onOversizedValue | back to summary |
|---|---|
| public void onOversizedValue() Invoked each time a user value exceeds the buffer size limit specified. This is recoverable. If the implementation wishes to recover, it should simply return normally from this method. The oversized value will be flushed from the buffer; normal processing will resume with the next value. If the implementation wishes to abort processing immediately, it may throw an exception from this method. | |