public class SplitPositionBufProcessor extends AbstractStringAwareBufProcessor implements io.netty.buffer.ByteBufProcessor
A ByteBufProcessor
to find the position of a single character usable as a split pivot. Applying this to a buffer will output the position of the closing of the section, relative to that buffer’s readerIndex, or -1 if the end of the section couldn’t be found.
Note that this processor is typically used to find split positions in a JSON array inside a streaming JSON response (in which case the constructor variant that detects JSON strings should be used).
It is invoked on a ByteBuf
by calling ByteBuf.forEachByte(ByteBufProcessor)
methods.
Constructor and Description |
---|
SplitPositionBufProcessor(char splitChar) |
SplitPositionBufProcessor(char splitChar,
boolean detectJsonString) |
Modifier and Type | Method and Description |
---|---|
boolean |
process(byte current) |
isEscaped
public SplitPositionBufProcessor(char splitChar)
splitChar
- the split character to find.public SplitPositionBufProcessor(char splitChar, boolean detectJsonString)
splitChar
- the split character to find.detectJsonString
- set to true to not inspect bytes detected as being part of a String.Copyright © 2018 Couchbase, Inc.. All rights reserved.