code: private static int read(InputStream is) throws IOException {
          int b = is.read();
          if (b == -1) {
              throw new EOFException();
          }
          return b;
      }
docs: Simple wrapper around {@link InputStream#read()} that throws EOFException
  instead of returning -1.