code: private long getRemainingBytes() {
          if (in != null) {
              if (!useLoadBuf) {
                  return in.remaining();
              }
              try {
                  if (channel.isOpen()) {
                      return channelSize - channel.position() + in.remaining();
                  } else {
                      return in.remaining();
                  }
              } catch (Exception e) {
                  log.error("Error getRemainingBytes", e);
              }
          }
          return 0;
      }
docs: Get the remaining bytes that could be read from a file or ByteBuffer.
  
  @return Number of remaining bytes