Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ToInt16() [1/2]

static short System.BitConverter.ToInt16 ( byte[] value,
int startIndex )
inlinestatic

Definition at line 220 of file BitConverter.cs.

221 {
222 if (value == null)
223 {
224 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
225 }
226 if ((uint)startIndex >= (uint)value.Length)
227 {
228 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_Index);
229 }
230 if (startIndex > value.Length - 2)
231 {
232 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall, ExceptionArgument.value);
233 }
234 return Unsafe.ReadUnaligned<short>(ref value[startIndex]);
235 }

References System.startIndex, System.ThrowHelper.ThrowArgumentException(), System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowArgumentOutOfRangeException(), and System.value.

Referenced by System.Net.SocketAddressPal.GetAddressFamily(), System.BitConverter.ToChar(), System.BitConverter.ToHalf(), and System.BitConverter.ToUInt16().