public static byte[] toArray(final List<Byte> list){
  final byte[] output=new byte[list.size()];
  for (int i=0; i < output.length; i++) {
    output[i]=list.get(i);
  }
  return output;
}

public static byte [ ] toArray ( final List < Byte > list ) { final byte [ ] output = new byte [ list . size ( ) ] ; for ( int i = 0 ; i < output . length ; i ++ ) { output [ i ] = list . get ( i ) ; } return output ; }
converts a list of bytes into a byte array .
