FlatBuffers.ByteBuffer.GetUshort C# (CSharp) Method

GetUshort() public method

public GetUshort ( int offset ) : ushort
offset int
return ushort
        public unsafe ushort GetUshort(int offset)
        {
            AssertOffsetAndLength(offset, sizeof(ushort));
            fixed (byte* ptr = _buffer)
            {
                return BitConverter.IsLittleEndian
                    ? *(ushort*)(ptr + offset)
                    : ReverseBytes(*(ushort*)(ptr + offset));
            }
        }

Usage Example

 public bool MoveNext()
 {
     if (_pos >= _end)
     {
         return(false);
     }
     Current = _buffer.GetUshort(_pos);
     _pos   += Size;
     return(true);
 }
All Usage Examples Of FlatBuffers.ByteBuffer::GetUshort