public ByteBuffer toThrift() {
    Buffer buffer = Buffer.allocate(sizeInBytes());
    write(buffer);
    return ByteBuffer.wrap(buffer.toByteArray());
  }
public ByteBuffer toThrift ( ) { Buffer buffer = Buffer . allocate ( sizeInBytes ( ) ) ; write ( buffer ) ; return ByteBuffer . wrap ( buffer . toByteArray ( ) ) ; }
Writes the current instance in TBinaryProtocol