public void Skip(int count) { this.positionIndex += count; DecoderErrorCode errorCode = this.positionIndex >= this.InputStream.Length ? DecoderErrorCode.UnexpectedEndOfStream : DecoderErrorCode.NoError; errorCode.EnsureNoError(); }
public int ReceiveExtend(int t, ref InputProcessor inputProcessor) { int x; DecoderErrorCode errorCode = this.ReceiveExtendUnsafe(t, ref inputProcessor, out x); errorCode.EnsureNoError(); return(x); }
public byte ReadByte(Stream inputStream) { byte result; DecoderErrorCode errorCode = this.ReadByteUnsafe(inputStream, out result); errorCode.EnsureNoError(); return(result); }
/// <summary> /// If errorCode indicates unexpected EOF, sets <see cref="UnexpectedEndOfStreamReached"/> to true and returns false. /// Calls <see cref="DecoderThrowHelper.EnsureNoError"/> and returns true otherwise. /// </summary> /// <param name="errorCode">The <see cref="DecoderErrorCode"/></param> /// <returns><see cref="bool"/> indicating whether everything is OK</returns> public bool CheckEOFEnsureNoError(DecoderErrorCode errorCode) { if (errorCode == DecoderErrorCode.UnexpectedEndOfStream) { this.UnexpectedEndOfStreamReached = true; return(false); } errorCode.EnsureNoError(); return(true); }
public Span <byte> ReadFull(int offset, int length) { DecoderErrorCode errorCode = DecoderErrorCode.NoError; if (this.InputStream.Length < this.positionIndex + offset + length) { errorCode = DecoderErrorCode.UnexpectedEndOfStream; } errorCode.EnsureNoError(); Span <byte> span = this.InputStream.Slice(this.positionIndex + offset, length); this.positionIndex += length; return(span); }
public void EnsureNBits(int n, ref InputProcessor inputProcessor) { DecoderErrorCode errorCode = this.EnsureNBitsUnsafe(n, ref inputProcessor); errorCode.EnsureNoError(); }
public void ReadFull(byte[] data, int offset, int length) { DecoderErrorCode errorCode = this.ReadFullUnsafe(data, offset, length); errorCode.EnsureNoError(); }
public void Skip(int count) { DecoderErrorCode errorCode = this.SkipUnsafe(count); errorCode.EnsureNoError(); }
public void Fill(Stream inputStream) { DecoderErrorCode errorCode = this.FillUnsafe(inputStream); errorCode.EnsureNoError(); }