code: public byte[] generateSeed(int length) throws SeedException
      {
          FileInputStream file = null;
          try
          {
              file = new FileInputStream(DEV_RANDOM);
              byte[] randomSeed = new byte[length];
              int count = 0;
              while (count < length)
              {
                  int bytesRead = file.read(randomSeed, count, length - count);
                  if (bytesRead == -1)
                  {
                      throw new SeedException("EOF encountered reading random data.");
                  }
                  count += bytesRead;
              }
              return randomSeed;
          }
          catch (IOException ex)
          {
              throw new SeedException("Failed reading from " + DEV_RANDOM.getName(), ex);
          }
          catch (SecurityException ex)
          {
              // Might be thrown if resource access is restricted (such as in
              // an applet sandbox).
              throw new SeedException("SecurityManager prevented access to " + DEV_RANDOM.getName(), ex);
          }
          finally
          {
              if (file != null)
              {
                  try
                  {
                      file.close();
                  }
                  catch (IOException ex)
                  {
                      // Ignore.
                  }
              }
          }
      }
docs: {@inheritDoc}
  @return The requested number of random bytes, read directly from
  {@literal /dev/random}.
  @throws SeedException If {@literal /dev/random} does not exist or is
  not accessible