/** Returns all data written and resets the stream to be empty. */
 public List<ByteBuffer> getBufferList() {
   List<ByteBuffer> result = buffers;
   reset();
   for (ByteBuffer buffer : result) {
     buffer.flip();
   }
   return result;
 }
 public ByteBufferOutputStream() {
   reset();
 }