code: public static byte[] toArray(Collection<? extends Number> bytes) {
      byte[] array = new byte[bytes.size()];
      Iterator<? extends Number> iter = bytes.iterator();
      for (int i = 0; i < bytes.size(); i++) {
        array[i] = iter.next().byteValue();
      }
      return array;
    }
docs: Converts a Collection of Number to a byte array.
  
  @param bytes
  a Collection of Number
  @return byte array