code: public byte[] toByteArray()
  	{
  		final byte[] r = new byte[size];
  		int off = 0;
  		final int n = arrays.size();
  		for(int k = 0; k < n; k++) {
  			byte[] src = (byte[])arrays.get(k);
  			System.arraycopy(src, 0, r, off, src.length);
  			off += src.length;
  		}
  		if(pos > 0) System.arraycopy(buffer, 0, r, off, pos);
  		return r;
  	}
docs: Allocates a new array and copies all data that has been written to this buffer to the newly allocated array.
  
  @return a new byte array