docs: public static void readAll(InputStream in, byte[] buf, int offset, int len) throws IOException
      {
          int rem = len;
          while (rem > 0)
          {
              int amount = in.read(buf, offset, rem);
              if (amount <= 0)
              {
                  // try to throw a useful exception
                  if (in instanceof Reader)
                  {
                      ((Reader) in).throwUnexpectedEOFException();
                  }
                  // defer to a plain exception
                  throw new IonException("Unexpected EOF");
              }
              rem -= amount;
              offset += amount;
          }
      }