@Override public void mark(int readlimit) { buffer.markReaderIndex(); }
@Override public ByteBuf markReaderIndex() { buf.markReaderIndex(); return this; }
@Override public final ByteBuf markReaderIndex() { buf.markReaderIndex(); return this; }
@Override public ByteBuf markReaderIndex() { buffer.markReaderIndex(); return this; }
@Override public final ByteBuf markReaderIndex() { buf.markReaderIndex(); return this; }
@Override public ByteBuf markReaderIndex() { buf.markReaderIndex(); return this; }
@Override public ByteBuf markReaderIndex() { buffer.markReaderIndex(); return this; }
@Override public void mark(int readlimit) { buffer.markReaderIndex(); }
startIndex = buffer.readerIndex(); endIndex = startIndex + length; buffer.markReaderIndex();
startIndex = buffer.readerIndex(); endIndex = startIndex + length; buffer.markReaderIndex();
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { in.markReaderIndex(); final byte[] buf = new byte[5]; for (int i = 0; i < buf.length; i ++) {
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { in.markReaderIndex(); final byte[] buf = new byte[5]; for (int i = 0; i < buf.length; i ++) {
private void decideBetweenRawAndObjects(boolean lastChunk) { responseContent.markReaderIndex(); int openArrayPos = findNextChar(responseContent, '['); if (openArrayPos > -1) {
private void decideBetweenRawAndObjects(boolean lastChunk) { responseContent.markReaderIndex(); int openArrayPos = findNextChar(responseContent, '['); if (openArrayPos > -1) {
private void decideBetweenRawAndObjects(boolean lastChunk) { responseContent.markReaderIndex(); int openArrayPos = findNextChar(responseContent, '['); if (openArrayPos > -1) {
/** * Last before the end of the stream, we can now parse the final result status * (including full execution of the query). */ private void parseQueryStatus(boolean lastChunk) { //some sections don't always come up, unlike status. Take this chance to close said sections' observables here. querySignatureObservable.onCompleted(); queryRowObservable.onCompleted(); queryErrorObservable.onCompleted(); responseContent.markReaderIndex(); responseContent.skipBytes(findNextChar(responseContent, '"') + 1); int endStatus = findNextChar(responseContent, '"'); if (endStatus > -1) { ByteBuf resultSlice = responseContent.readSlice(endStatus); queryStatusObservable.onNext(resultSlice.toString(CHARSET)); queryStatusObservable.onCompleted(); sectionDone(); queryParsingState = transitionToNextToken(lastChunk); } else { responseContent.resetReaderIndex(); return; //need more data } }
/** * Last before the end of the stream, we can now parse the final result status * (including full execution of the query). */ private void parseQueryStatus(boolean lastChunk) { //some sections don't always come up, unlike status. Take this chance to close said sections' observables here. querySignatureObservable.onCompleted(); queryRowObservable.onCompleted(); queryErrorObservable.onCompleted(); responseContent.markReaderIndex(); responseContent.skipBytes(findNextChar(responseContent, '"') + 1); int endStatus = findNextChar(responseContent, '"'); if (endStatus > -1) { ByteBuf resultSlice = responseContent.readSlice(endStatus); queryStatusObservable.onNext(resultSlice.toString(CHARSET)); queryStatusObservable.onCompleted(); sectionDone(); queryParsingState = transitionToNextToken(lastChunk); } else { responseContent.resetReaderIndex(); return; //need more data } }
/** * Last before the end of the stream, we can now parse the final result status * (including full execution of the query). */ private void parseQueryStatus(boolean lastChunk) { //some sections don't always come up, unlike status. Take this chance to close said sections' observables here. querySignatureObservable.onCompleted(); queryRowObservable.onCompleted(); queryErrorObservable.onCompleted(); responseContent.markReaderIndex(); responseContent.skipBytes(findNextChar(responseContent, '"') + 1); int endStatus = findNextChar(responseContent, '"'); if (endStatus > -1) { ByteBuf resultSlice = responseContent.readSlice(endStatus); queryStatusObservable.onNext(resultSlice.toString(CHARSET)); queryStatusObservable.onCompleted(); sectionDone(); queryParsingState = transitionToNextToken(lastChunk); } else { responseContent.resetReaderIndex(); return; //need more data } }
/** * Last before the end of the stream, we can now parse the final result status * (including full execution of the query). */ private void parseQueryStatus(boolean lastChunk) { //some sections don't always come up, unlike status. Take this chance to close said sections' observables here. querySignatureObservable.onCompleted(); queryRowObservable.onCompleted(); queryErrorObservable.onCompleted(); responseContent.markReaderIndex(); responseContent.skipBytes(findNextChar(responseContent, '"') + 1); int endStatus = findNextChar(responseContent, '"'); if (endStatus > -1) { ByteBuf resultSlice = responseContent.readSlice(endStatus); queryStatusObservable.onNext(resultSlice.toString(CHARSET)); queryStatusObservable.onCompleted(); sectionDone(); queryParsingState = transitionToNextToken(lastChunk); } else { responseContent.resetReaderIndex(); return; //need more data } }
input.markReaderIndex(); byte first = input.readByte(); input.resetReaderIndex();