code: @Override
    public int available() throws IOException {
      if (dataSegmentIn == null) {
        if (!moveToNextDataSegment()) {
          return 0;
        }
      }
      do {
        int result = dataSegmentIn.available();
        if (result != 0) {
          return result;
        }
        if (!moveToNextDataSegment()) {
          return 0;
        }
      } while (true);
    }
docs: This function depends on that the underlying dataSegmentIn.available() only
  returns 0 when EOF.  Otherwise it will break because it jumps over the dataSegmentIn
  that has available() == 0.