OpenStory.Common.IO.PacketReadingException.EndOfStream C# (CSharp) Method

EndOfStream() public static method

Constructs a PacketReadingException which states that the end of the stream was reached.
public static EndOfStream ( ) : PacketReadingException
return PacketReadingException
        public static PacketReadingException EndOfStream()
        {
            return new PacketReadingException(CommonStrings.EndOfStreamReached);
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Advances the stream by a number of positions and returns the original position.
        /// </summary>
        /// <param name="count">The number of positions to advance.</param>
        /// <exception cref="InvalidOperationException">
        /// Thrown if the position will fall outside the bounds of the underlying array segment.
        /// </exception>
        /// <returns>the position of the stream before advancing.</returns>
        private int CheckedAdvance(int count)
        {
            if (_currentOffset + count > _segmentEnd)
            {
                throw PacketReadingException.EndOfStream();
            }

            int old = _currentOffset;

            _currentOffset += count;
            return(old);
        }
All Usage Examples Of OpenStory.Common.IO.PacketReadingException::EndOfStream