本文整理了Java中com.couchbase.client.deps.io.netty.buffer.ByteBuf.markReaderIndex()
方法的一些代码示例,展示了ByteBuf.markReaderIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.markReaderIndex()
方法的具体详情如下:
包路径:com.couchbase.client.deps.io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:markReaderIndex
[英]Marks the current readerIndex in this buffer. You can reposition the current readerIndex to the marked readerIndex by calling #resetReaderIndex(). The initial value of the marked readerIndex is 0.
[中]标记此缓冲区中的当前readerIndex。通过调用#resetReaderIndex(),可以将当前readerIndex重新定位到标记的readerIndex。标记的readerIndex的初始值为0。
代码示例来源:origin: com.couchbase.client/core-io
@Override
public void mark(int readlimit) {
buffer.markReaderIndex();
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf markReaderIndex() {
buf.markReaderIndex();
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public final ByteBuf markReaderIndex() {
buf.markReaderIndex();
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf markReaderIndex() {
buffer.markReaderIndex();
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public final ByteBuf markReaderIndex() {
buf.markReaderIndex();
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf markReaderIndex() {
buf.markReaderIndex();
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf markReaderIndex() {
buffer.markReaderIndex();
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public void mark(int readlimit) {
buffer.markReaderIndex();
}
代码示例来源:origin: com.couchbase.client/core-io
startIndex = buffer.readerIndex();
endIndex = startIndex + length;
buffer.markReaderIndex();
代码示例来源:origin: couchbase/couchbase-jvm-core
startIndex = buffer.readerIndex();
endIndex = startIndex + length;
buffer.markReaderIndex();
代码示例来源:origin: com.couchbase.client/core-io
@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 ++) {
代码示例来源:origin: couchbase/couchbase-jvm-core
@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 ++) {
代码示例来源:origin: com.couchbase.client/core-io
private void decideBetweenRawAndObjects(boolean lastChunk) {
responseContent.markReaderIndex();
int openArrayPos = findNextChar(responseContent, '[');
if (openArrayPos > -1) {
代码示例来源:origin: com.couchbase.client/core-io
private void decideBetweenRawAndObjects(boolean lastChunk) {
responseContent.markReaderIndex();
int openArrayPos = findNextChar(responseContent, '[');
if (openArrayPos > -1) {
代码示例来源:origin: couchbase/couchbase-jvm-core
private void decideBetweenRawAndObjects(boolean lastChunk) {
responseContent.markReaderIndex();
int openArrayPos = findNextChar(responseContent, '[');
if (openArrayPos > -1) {
代码示例来源:origin: com.couchbase.client/core-io
/**
* 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
}
}
代码示例来源:origin: couchbase/couchbase-jvm-core
/**
* 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
}
}
代码示例来源:origin: com.couchbase.client/core-io
/**
* 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
}
}
代码示例来源:origin: couchbase/couchbase-jvm-core
/**
* 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
}
}
代码示例来源:origin: com.couchbase.client/java-client
input.markReaderIndex();
byte first = input.readByte();
input.resetReaderIndex();
内容来源于网络,如有侵权,请联系作者删除!