com.couchbase.client.deps.io.netty.buffer.ByteBuf.resetReaderIndex()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中com.couchbase.client.deps.io.netty.buffer.ByteBuf.resetReaderIndex()方法的一些代码示例,展示了ByteBuf.resetReaderIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.resetReaderIndex()方法的具体详情如下:
包路径:com.couchbase.client.deps.io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:resetReaderIndex

ByteBuf.resetReaderIndex介绍

[英]Repositions the current readerIndex to the marked readerIndex in this buffer.
[中]将当前readerIndex重新定位到此缓冲区中标记的readerIndex。

代码示例

代码示例来源:origin: com.couchbase.client/core-io

@Override
public ByteBuf resetReaderIndex() {
  buf.resetReaderIndex();
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public ByteBuf resetReaderIndex() {
  buffer.resetReaderIndex();
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public final ByteBuf resetReaderIndex() {
  buf.resetReaderIndex();
  return this;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public ByteBuf resetReaderIndex() {
  buf.resetReaderIndex();
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

@Override
public void reset() throws IOException {
  buffer.resetReaderIndex();
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public void reset() throws IOException {
  buffer.resetReaderIndex();
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public ByteBuf resetReaderIndex() {
  buffer.resetReaderIndex();
  return this;
}

代码示例来源:origin: couchbase/couchbase-jvm-core

@Override
public final ByteBuf resetReaderIndex() {
  buf.resetReaderIndex();
  return this;
}

代码示例来源:origin: com.couchbase.client/core-io

for (int i = 0; i < buf.length; i ++) {
  if (!in.isReadable()) {
    in.resetReaderIndex();
    return;
      in.resetReaderIndex();
      return;
    } else {

代码示例来源:origin: couchbase/couchbase-jvm-core

for (int i = 0; i < buf.length; i ++) {
  if (!in.isReadable()) {
    in.resetReaderIndex();
    return;
      in.resetReaderIndex();
      return;
    } else {

代码示例来源:origin: com.couchbase.client/core-io

responseContent.skipBytes(openArrayPos + 1);
} else {
  responseContent.resetReaderIndex();
  if (lastChunk == true) {
    throw new IllegalStateException("Unable to decide between raw and objects with content " + responseContent.toString(CHARSET));
} else {
  responseContent.resetReaderIndex();
  return;
  responseContent.resetReaderIndex();

代码示例来源:origin: com.couchbase.client/core-io

responseContent.skipBytes(openArrayPos + 1);
} else {
  responseContent.resetReaderIndex();
  if (lastChunk == true) {
    throw new IllegalStateException("Unable to decide between raw and objects with content " + responseContent.toString(CHARSET));
} else {
  responseContent.resetReaderIndex();
  return;
  responseContent.resetReaderIndex();

代码示例来源:origin: couchbase/couchbase-jvm-core

responseContent.skipBytes(openArrayPos + 1);
} else {
  responseContent.resetReaderIndex();
  if (lastChunk == true) {
    throw new IllegalStateException("Unable to decide between raw and objects with content " + responseContent.toString(CHARSET));
} else {
  responseContent.resetReaderIndex();
  return;
  responseContent.resetReaderIndex();

代码示例来源:origin: couchbase/couchbase-jvm-core

responseContent.skipBytes(openArrayPos + 1);
} else {
  responseContent.resetReaderIndex();
  if (lastChunk == true) {
    throw new IllegalStateException("Unable to decide between raw and objects with content " + responseContent.toString(CHARSET));
} else {
  responseContent.resetReaderIndex();
  return;
  responseContent.resetReaderIndex();

代码示例来源: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: com.couchbase.client/core-io

out.readBytes(out, length);
out.resetReaderIndex();

代码示例来源: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: couchbase/couchbase-jvm-core

out.readBytes(out, length);
out.resetReaderIndex();

代码示例来源: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
  }
}

相关文章