internal virtual void WriteSequence() { Debug.Assert(SequenceIsConsistent()); try { WriteHeader(reverse, clean, dirtyWords.Length); } catch (IOException cannotHappen) { throw new InvalidOperationException(cannotHappen.ToString(), cannotHappen); // LUCENENET NOTE: This was AssertionError in Lucene } @out.WriteBytes(dirtyWords.Bytes, 0, dirtyWords.Length); dirtyWords.Length = 0; ++numSequences; }
internal virtual void WriteSequence() { if (Debugging.AssertsEnabled) { Debugging.Assert(SequenceIsConsistent()); } try { WriteHeader(reverse, clean, dirtyWords.Length); } catch (Exception cannotHappen) when(cannotHappen.IsIOException()) { throw AssertionError.Create(cannotHappen.Message, cannotHappen); } @out.WriteBytes(dirtyWords.Bytes, 0, dirtyWords.Length); dirtyWords.Length = 0; ++numSequences; }