code: int readFromInputStream(byte[] buffer, InputStream is) {
      try {
        return is.read(buffer);
      } catch (IOException e) {
        if (END_OF_STREAM.equals(e.getMessage())) {
          return -2;
        }
  
        return Integer.MIN_VALUE;
      }
    }
docs: /* read data from input stream