code: void readAll() {
          try {
              try {
                  int b = input.read();
                  while (b >= 0) {
                      readObject(b);
                      b = input.read();
                  }
              } finally {
                  input.close();
              }
          } catch (IOException ex) {
              throw new IllegalStateException(ex);
          }
      }
docs: Reads all the data in the stream, closing the stream.