protected void transfer(String seqRange) throws IOException {
  try {
    final int rangePos=seqRange.indexOf('-');
    if (rangePos == -1) {
      transfer(Long.parseLong(seqRange));
    }
 else {
      final String start=seqRange.substring(0,rangePos);
      final String end=seqRange.substring(rangePos + 1);
      final long startIdx;
      if (start.length() == 0) {
        startIdx=0;
      }
 else {
        startIdx=Long.parseLong(start);
      }
      final long endIdx;
      if (end.length() == 0) {
        endIdx=mReader.numberSequences() - 1;
      }
 else {
        endIdx=Long.parseLong(end);
      }
      if (startIdx > endIdx) {
        throw new NumberFormatException("Invalid range: " + seqRange);
      }
      for (long i=startIdx; i <= endIdx; i++) {
        transfer(i);
      }
    }
  }
 catch (  final NumberFormatException e) {
    warnInvalidSequence(seqRange);
  }
}

protected void transfer ( String seqRange ) throws IOException { try { final int rangePos = seqRange . indexOf ( '-' ) ; if ( rangePos == - 1 ) { transfer ( Long . parseLong ( seqRange ) ) ; } else { final String start = seqRange . substring ( 0 , rangePos ) ; final String end = seqRange . substring ( rangePos + 1 ) ; final long startIdx ; if ( start . length ( ) == 0 ) { startIdx = 0 ; } else { startIdx = Long . parseLong ( start ) ; } final long endIdx ; if ( end . length ( ) == 0 ) { endIdx = mReader . numberSequences ( ) - 1 ; } else { endIdx = Long . parseLong ( end ) ; } if ( startIdx > endIdx ) { throw new NumberFormatException ( "Invalid range: " + seqRange ) ; } for ( long i = startIdx ; i <= endIdx ; i ++ ) { transfer ( i ) ; } } } catch ( final NumberFormatException e ) { warnInvalidSequence ( seqRange ) ; } }
transfer an interpreted sequence or set of sequences from the reader to the writer . this implementation allows ids to be specified as a range , e . g . 123 - 456
