public static byte[] newBytes(int len){
  if (len == 0) {
    return EMPTY_BYTES;
  }
  try {
    return new byte[len];
  }
 catch (  OutOfMemoryError e) {
    Error e2=new OutOfMemoryError("Requested memory: " + len);
    e2.initCause(e);
    throw e2;
  }
}

public static byte [ ] newBytes ( int len ) { if ( len == 0 ) { return EMPTY_BYTES ; } try { return new byte [ len ] ; } catch ( OutOfMemoryError e ) { Error e2 = new OutOfMemoryError ( "Requested memory: " + len ) ; e2 . initCause ( e ) ; throw e2 ; } }
create an array of bytes with the given size . if this is not possible because not enough memory is available , an outofmemoryerror with the requested size in the message is thrown . < p > this method should be used if the size of the array is user defined , or stored in a file , so wrong size data can be distinguished from regular out - of - memory .
