docs: public void readFrom(InputStream is) throws IOException {
          while(true) {
              if(count==buf.length) {
                  // reallocate
                  byte[] data = new byte[buf.length*2];
                  System.arraycopy(buf,0,data,0,buf.length);
                  buf = data;
              }
  
              int sz = is.read(buf,count,buf.length-count);
              if(sz<0)     return;
              count += sz;
          }
      }