docs: public static final int readAll(ReadableByteChannel ch, ByteBuffer dst) throws IOException
      {
          int count = 0;
          while (dst.hasRemaining())
          {
              int rc = ch.read(dst);
              if (rc == -1)
              {
                  if (count > 0)
                  {
                      return count;
                  }
                  return -1;
              }
              count += rc;
          }
          return count;
      }