コード例 #1
0
 @Override
 public ByteBufferImpl readObject(ObjectInput input) throws IOException, ClassNotFoundException {
   int length = UnsignedNumeric.readUnsignedInt(input);
   byte[] data = new byte[length];
   input.readFully(data, 0, length);
   return new ByteBufferImpl(data, 0, length);
 }
コード例 #2
0
 @Override
 public void writeObject(ObjectOutput output, ByteBufferImpl b) throws IOException {
   UnsignedNumeric.writeUnsignedInt(output, b.length);
   output.write(b.buf, b.offset, b.length);
 }