code: public static int readFully(InputStream in, byte[] buf)
      throws IOException
      {
          return readFully(in, buf, 0, buf.length);
      }
docs: Calls {@link InputStream#read(byte[], int, int)} until the buffer is
  filled or EOF is encountered.
  This method will block until the request is satisfied.
  
  @param in        The stream to read from.
  @param buf       The buffer to read to.
  
  @return the number of bytes read from the stream.  May be less than
  {@code buf.length} if EOF is encountered before reading that far.
  
  @see #readFully(InputStream, byte[], int, int)