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

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

本文整理了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

  1. @Override
  2. public ByteBuf resetReaderIndex() {
  3. buf.resetReaderIndex();
  4. return this;
  5. }

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

  1. @Override
  2. public ByteBuf resetReaderIndex() {
  3. buffer.resetReaderIndex();
  4. return this;
  5. }

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

  1. @Override
  2. public final ByteBuf resetReaderIndex() {
  3. buf.resetReaderIndex();
  4. return this;
  5. }

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

  1. @Override
  2. public ByteBuf resetReaderIndex() {
  3. buf.resetReaderIndex();
  4. return this;
  5. }

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

  1. @Override
  2. public void reset() throws IOException {
  3. buffer.resetReaderIndex();
  4. }

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

  1. @Override
  2. public void reset() throws IOException {
  3. buffer.resetReaderIndex();
  4. }

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

  1. @Override
  2. public ByteBuf resetReaderIndex() {
  3. buffer.resetReaderIndex();
  4. return this;
  5. }

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

  1. @Override
  2. public final ByteBuf resetReaderIndex() {
  3. buf.resetReaderIndex();
  4. return this;
  5. }

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

  1. for (int i = 0; i < buf.length; i ++) {
  2. if (!in.isReadable()) {
  3. in.resetReaderIndex();
  4. return;
  5. in.resetReaderIndex();
  6. return;
  7. } else {

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

  1. for (int i = 0; i < buf.length; i ++) {
  2. if (!in.isReadable()) {
  3. in.resetReaderIndex();
  4. return;
  5. in.resetReaderIndex();
  6. return;
  7. } else {

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Last before the end of the stream, we can now parse the final result status
  3. * (including full execution of the query).
  4. */
  5. private void parseQueryStatus(boolean lastChunk) {
  6. //some sections don't always come up, unlike status. Take this chance to close said sections' observables here.
  7. querySignatureObservable.onCompleted();
  8. queryRowObservable.onCompleted();
  9. queryErrorObservable.onCompleted();
  10. responseContent.markReaderIndex();
  11. responseContent.skipBytes(findNextChar(responseContent, '"') + 1);
  12. int endStatus = findNextChar(responseContent, '"');
  13. if (endStatus > -1) {
  14. ByteBuf resultSlice = responseContent.readSlice(endStatus);
  15. queryStatusObservable.onNext(resultSlice.toString(CHARSET));
  16. queryStatusObservable.onCompleted();
  17. sectionDone();
  18. queryParsingState = transitionToNextToken(lastChunk);
  19. } else {
  20. responseContent.resetReaderIndex();
  21. return; //need more data
  22. }
  23. }

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

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

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

  1. /**
  2. * Last before the end of the stream, we can now parse the final result status
  3. * (including full execution of the query).
  4. */
  5. private void parseQueryStatus(boolean lastChunk) {
  6. //some sections don't always come up, unlike status. Take this chance to close said sections' observables here.
  7. querySignatureObservable.onCompleted();
  8. queryRowObservable.onCompleted();
  9. queryErrorObservable.onCompleted();
  10. responseContent.markReaderIndex();
  11. responseContent.skipBytes(findNextChar(responseContent, '"') + 1);
  12. int endStatus = findNextChar(responseContent, '"');
  13. if (endStatus > -1) {
  14. ByteBuf resultSlice = responseContent.readSlice(endStatus);
  15. queryStatusObservable.onNext(resultSlice.toString(CHARSET));
  16. queryStatusObservable.onCompleted();
  17. sectionDone();
  18. queryParsingState = transitionToNextToken(lastChunk);
  19. } else {
  20. responseContent.resetReaderIndex();
  21. return; //need more data
  22. }
  23. }

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

  1. /**
  2. * Last before the end of the stream, we can now parse the final result status
  3. * (including full execution of the query).
  4. */
  5. private void parseQueryStatus(boolean lastChunk) {
  6. //some sections don't always come up, unlike status. Take this chance to close said sections' observables here.
  7. querySignatureObservable.onCompleted();
  8. queryRowObservable.onCompleted();
  9. queryErrorObservable.onCompleted();
  10. responseContent.markReaderIndex();
  11. responseContent.skipBytes(findNextChar(responseContent, '"') + 1);
  12. int endStatus = findNextChar(responseContent, '"');
  13. if (endStatus > -1) {
  14. ByteBuf resultSlice = responseContent.readSlice(endStatus);
  15. queryStatusObservable.onNext(resultSlice.toString(CHARSET));
  16. queryStatusObservable.onCompleted();
  17. sectionDone();
  18. queryParsingState = transitionToNextToken(lastChunk);
  19. } else {
  20. responseContent.resetReaderIndex();
  21. return; //need more data
  22. }
  23. }

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

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

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

  1. /**
  2. * Last before the end of the stream, we can now parse the final result status
  3. * (including full execution of the query).
  4. */
  5. private void parseQueryStatus(boolean lastChunk) {
  6. //some sections don't always come up, unlike status. Take this chance to close said sections' observables here.
  7. querySignatureObservable.onCompleted();
  8. queryRowObservable.onCompleted();
  9. queryErrorObservable.onCompleted();
  10. responseContent.markReaderIndex();
  11. responseContent.skipBytes(findNextChar(responseContent, '"') + 1);
  12. int endStatus = findNextChar(responseContent, '"');
  13. if (endStatus > -1) {
  14. ByteBuf resultSlice = responseContent.readSlice(endStatus);
  15. queryStatusObservable.onNext(resultSlice.toString(CHARSET));
  16. queryStatusObservable.onCompleted();
  17. sectionDone();
  18. queryParsingState = transitionToNextToken(lastChunk);
  19. } else {
  20. responseContent.resetReaderIndex();
  21. return; //need more data
  22. }
  23. }

相关文章