@Test public void read_opaque_into_array() throws Exception { direct.put((byte)8).put((byte)9).put((byte)10).put((byte)11).flip(); array.put((byte)8).put((byte)9).put((byte)10).put((byte)11).flip(); byte[] direct_buf = new byte[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; new XdrBufferDecodingStream(direct).xdrDecodeOpaque(direct_buf, 3, 3); byte[] array_buf = new byte[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; new XdrBufferDecodingStream(array).xdrDecodeOpaque(array_buf, 3, 3); assertArrayEquals(new byte[]{ 0, 1, 2, 8, 9, 10, 6, 7, 8, 9 }, direct_buf); assertArrayEquals(new byte[]{ 0, 1, 2, 8, 9, 10, 6, 7, 8, 9 }, array_buf); }
@Override public byte[] xdrDecodeOpaque(int length) throws OncRpcException, IOException { byte[] buf = new byte[length]; xdrDecodeOpaque(buf, 0, length); return buf; }
XdrBufferDecodingStream extends XdrDecodingStream { @Override public byte[] xdrDecodeOpaque(int length) throws OncRpcException, IOException { byte[] buf = new byte[length]; xdrDecodeOpaque(buf, 0, length); return buf; } }
XdrBufferDecodingStream extends XdrDecodingStream { @Override public byte[] xdrDecodeOpaque(int length) throws OncRpcException, IOException { byte[] buf = new byte[length]; xdrDecodeOpaque(buf, 0, length); return buf; } XdrBufferDecodingStream(ByteBuffer buf, BufferSupplier buf_supplier);  XdrBufferDecodingStream(BufferSupplier buf_supplier);  XdrBufferDecodingStream(int bufsize, BufferSupplier buf_supplier);  XdrBufferDecodingStream(ByteBuffer buf); }
XdrBufferDecodingStream extends XdrDecodingStream { @Override public byte[] xdrDecodeOpaque(int length) throws OncRpcException, IOException { byte[] buf = new byte[length]; xdrDecodeOpaque(buf, 0, length); return buf; } XdrBufferDecodingStream(ByteBuffer buf, BufferSupplier buf_supplier);  XdrBufferDecodingStream(BufferSupplier buf_supplier);  XdrBufferDecodingStream(int bufsize, BufferSupplier buf_supplier);  XdrBufferDecodingStream(ByteBuffer buf); @Override void beginDecoding(); @Override void endDecoding(); @Override InetAddress getSenderAddress(); @Override int getSenderPort(); @Override int xdrDecodeInt(); @Override byte[] xdrDecodeOpaque(int length); @Override void xdrDecodeOpaque(byte[] opaque, int offset, int length); long readBytes(); long avail(); boolean atEof(); }
XdrBufferDecodingStream extends XdrDecodingStream { @Override public byte[] xdrDecodeOpaque(int length) throws OncRpcException, IOException { byte[] buf = new byte[length]; xdrDecodeOpaque(buf, 0, length); return buf; } XdrBufferDecodingStream(ByteBuffer buf, BufferSupplier buf_supplier);  XdrBufferDecodingStream(BufferSupplier buf_supplier);  XdrBufferDecodingStream(int bufsize, BufferSupplier buf_supplier);  XdrBufferDecodingStream(ByteBuffer buf); @Override void beginDecoding(); @Override void endDecoding(); @Override InetAddress getSenderAddress(); @Override int getSenderPort(); @Override int xdrDecodeInt(); @Override byte[] xdrDecodeOpaque(int length); @Override void xdrDecodeOpaque(byte[] opaque, int offset, int length); long readBytes(); long avail(); boolean atEof();  }