code: public void write( ByteBuffer byteBuffer ) throws IOException
      {
          byte[] tmp = new byte[BUFFER_SIZE]; 
          
          while ( byteBuffer.hasRemaining() )
          {
              int length = Math.min( byteBuffer.remaining(), tmp.length );
              byteBuffer.get( tmp, 0, length);
              write(tmp, 0, length);
          }
      }
docs: /* (non-Javadoc)
  @see ca.mjdsystems.jmatio.io.DataOutputStream#write(java.nio.ByteBuffer)