code: @Nonnegative
    public static int readFully (@Nonnull @WillNotClose final InputStream aIS,
                                 @Nonnull final byte [] aBuffer,
                                 @Nonnegative final int nOfs,
                                 @Nonnegative final int nLen) throws IOException
    {
      ValueEnforcer.notNull (aIS, "InputStream");
      ValueEnforcer.isArrayOfsLen (aBuffer, nOfs, nLen);
  
      int nTotalBytesRead = 0;
      while (nTotalBytesRead < nLen)
      {
        // Potentially blocking read
        final int nBytesRead = aIS.read (aBuffer, nOfs + nTotalBytesRead, nLen - nTotalBytesRead);
        if (nBytesRead < 0)
          throw new EOFException ("Failed to read a total of " +
                                  nLen +
                                  " bytes from input stream. Only read " +
                                  nTotalBytesRead +
                                  " bytes so far.");
        nTotalBytesRead += nBytesRead;
      }
      return nTotalBytesRead;
    }
docs: Read the whole buffer from the input stream.
  
  @param aIS
  The input stream to read from. May not be <code>null</code>.
  @param aBuffer
  The buffer to write to. May not be <code>null</code>. Must be &ge;
  than the content to be read.
  @param nOfs
  The offset into the destination buffer to use. May not be &lt; 0.
  @param nLen
  The number of bytes to read into the destination buffer to use. May
  not be &lt; 0.
  @return The number of read bytes
  @throws IOException
  In case reading fails