docs: @GwtIncompatible("InputStream")
    static InputStream asInputStream(final ByteInput input) {
      checkNotNull(input);
      return new InputStream() {
        @Override
        public int read() throws IOException {
          return input.read();
        }
  
        @Override
        public int read(byte[] b, int off, int len) throws IOException {
          checkNotNull(b);
          checkPositionIndexes(off, off + len, b.length);
          if (len == 0) {
            return 0;
          }
          int firstByte = read();
          if (firstByte == -1) {
            return -1;
          }
          b[off] = (byte) firstByte;
          for (int dst = 1; dst < len; dst++) {
            int readByte = read();
            if (readByte == -1) {
              return dst;
            }
            b[off + dst] = (byte) readByte;
          }
          return len;
        }
  
        @Override
        public void close() throws IOException {
          input.close();
        }
      };
    }