Github user nsuke commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/705#discussion_r46765176
  
    --- Diff: lib/java/src/org/apache/thrift/transport/TByteBuffer.java ---
    @@ -0,0 +1,88 @@
    +package org.apache.thrift.transport;
    +
    +import java.nio.BufferOverflowException;
    +import java.nio.BufferUnderflowException;
    +import java.nio.ByteBuffer;
    +
    +/**
    + * ByteBuffer-backed implementation of TTransport.
    + */
    +public class TByteBuffer extends TTransport {
    +  private ByteBuffer byteBuffer;
    +
    +  /**
    +   * Creates a new TByteBuffer wrapping a given NIO ByteBuffer.
    +   */
    +  public TByteBuffer(ByteBuffer byteBuffer) {
    +    this.byteBuffer = byteBuffer;
    +  }
    +
    +  /**
    +   * Resets the underlying NIO ByteBuffer.
    +   */
    +  public void reset(ByteBuffer byteBuffer) {
    --- End diff --
    
    Shouldn't this and nioBuffer be simple setter/getter  ?
    Since we have flip(), reset() can be misleading.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to