code: private void buffer() throws IOException {
          int remaining = buffer.length;
          while (remaining > 0) {
              int r = input.read(buffer, buffer.length - remaining, remaining);
              if (r <= 0) {
                  // Not enough information to fill the buffer
                  offset = 0;
                  maxOffset = buffer.length - remaining;
                  return;
              }
              remaining -= r;
          }
          maxOffset = buffer.length;
          offset = 0;
      }
docs: Fills the buffer.
  
  @throws IOException  if an IO error occurs