title: How to serialize ByteBuffer
body: <p>I wish to send a java.nio.ByteBuffer accross a network using RMI, however ByteBuffer isn't serializable. I've tried the following custom class to no avail:</p>
  
  <pre><code>public class NetByteBuffer implements java.io.Serializable {
  
  ByteBuffer buffer;
  
  public NetByteBuffer(ByteBuffer buffer) {
      this.buffer = buffer;
  }
  
  public ByteBuffer getByteBuffer() {
      return this.buffer;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The client still gets a non-serialzable exception. Any ideas?</p>
  
  <p>Thanks</p>