public byte[] toByteArray(){
  byte[] bytes=new byte[this.byteLength];
  int offset=0;
  for (  byte[] chunk : arrays) {
    System.arraycopy(chunk,0,bytes,offset,chunk.length);
    offset+=chunk.length;
  }
  return bytes;
}

public byte [ ] toByteArray ( ) { byte [ ] bytes = new byte [ this . byteLength ] ; int offset = 0 ; for ( byte [ ] chunk : arrays ) { System . arraycopy ( chunk , 0 , bytes , offset , chunk . length ) ; offset += chunk . length ; } return bytes ; }
expensive operation of allocating a byte array to hold the entire contents of this output and then copying each underlying byte array into this new byte array . lots of memory copying . . .
