public void put(byte[] data){
  if (data == null)   return;
  if (data.length + position >= getCapacity()) {
    byte[][] newbuf=new byte[(data.length + position) / SIZE + 2][];
    for (int i=0; i < buffer.length; i++)     newbuf[i]=buffer[i];
    for (int i=buffer.length; i < newbuf.length; i++)     newbuf[i]=new byte[SIZE];
    buffer=newbuf;
  }
  for (int i=0; i < data.length; i++) {
    buffer[position / SIZE][position % SIZE]=data[i];
    last=Math.max(last,(position++));
  }
}

public void put ( byte [ ] data ) { if ( data == null ) return ; if ( data . length + position >= getCapacity ( ) ) { byte [ ] [ ] newbuf = new byte [ ( data . length + position ) / SIZE + 2 ] [ ] ; for ( int i = 0 ; i < buffer . length ; i ++ ) newbuf [ i ] = buffer [ i ] ; for ( int i = buffer . length ; i < newbuf . length ; i ++ ) newbuf [ i ] = new byte [ SIZE ] ; buffer = newbuf ; } for ( int i = 0 ; i < data . length ; i ++ ) { buffer [ position / SIZE ] [ position % SIZE ] = data [ i ] ; last = Math . max ( last , ( position ++ ) ) ; } }
writes the given byte array to this bytebuffer , starting at the current position . advances the current position by data . length .
