commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Duncan Jones <>
Subject [LANG] Method to return random byte array?
Date Thu, 13 Jun 2013 08:03:20 GMT

A piece of code I write far too often is:

public static byte[] getRandomBytes(int length) {
  // validate length is non-negative

  byte[] result = new byte[length];
  return result;

Is there a place for something like this in Commons Lang? Or, better,
does this already exist in another commons project?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message