Show / Hide Table of Contents

Class NetConvert

Inheritance
System.Object
NetConvert
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.Sys
Assembly: SIPSorcery.dll
Syntax
public class NetConvert

Methods

| Improve this Doc View Source

DoReverseEndian(Int32)

Declaration
public static int DoReverseEndian(int x)
Parameters
Type Name Description
System.Int32 x
Returns
Type Description
System.Int32
| Improve this Doc View Source

DoReverseEndian(UInt16)

Declaration
public static ushort DoReverseEndian(ushort x)
Parameters
Type Name Description
System.UInt16 x
Returns
Type Description
System.UInt16
| Improve this Doc View Source

DoReverseEndian(UInt32)

Declaration
public static uint DoReverseEndian(uint x)
Parameters
Type Name Description
System.UInt32 x
Returns
Type Description
System.UInt32
| Improve this Doc View Source

DoReverseEndian(UInt64)

Declaration
public static ulong DoReverseEndian(ulong x)
Parameters
Type Name Description
System.UInt64 x
Returns
Type Description
System.UInt64
| Improve this Doc View Source

EndianFlip(UInt32)

Reverses the endianness of a UInt32.

Declaration
public static uint EndianFlip(uint val)
Parameters
Type Name Description
System.UInt32 val

The value to flip.

Returns
Type Description
System.UInt32

The same value but with the endianness flipped.

| Improve this Doc View Source

GetBytes(UInt16)

Get a buffer representing the unsigned 16 bit integer in network byte (big endian) order.

Declaration
public static byte[] GetBytes(ushort val)
Parameters
Type Name Description
System.UInt16 val

The value to convert.

Returns
Type Description
System.Byte[]

A buffer representing the value in network order

| Improve this Doc View Source

GetBytes(UInt32)

Get a buffer representing the 32 bit unsigned integer in network byte (big endian) order.

Declaration
public static byte[] GetBytes(uint val)
Parameters
Type Name Description
System.UInt32 val

The value to convert.

Returns
Type Description
System.Byte[]

A buffer representing the value in network order

| Improve this Doc View Source

GetBytes(UInt64)

Get a buffer representing the 64 bit unsigned integer in network byte (big endian) order.

Declaration
public static byte[] GetBytes(ulong val)
Parameters
Type Name Description
System.UInt64 val

The value to convert.

Returns
Type Description
System.Byte[]

A buffer representing the value in network order

| Improve this Doc View Source

ParseUInt16(Byte[], Int32)

Parse a UInt16 from a network buffer using network byte order.

Declaration
public static ushort ParseUInt16(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to parse the value from.

System.Int32 posn

The position in the buffer to start the parse from.

Returns
Type Description
System.UInt16

A UInt16 value.

| Improve this Doc View Source

ParseUInt32(Byte[], Int32)

Parse a UInt32 from a network buffer using network byte order.

Declaration
public static uint ParseUInt32(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to parse the value from.

System.Int32 posn

The position in the buffer to start the parse from.

Returns
Type Description
System.UInt32

A UInt32 value.

| Improve this Doc View Source

ParseUInt64(Byte[], Int32)

Parse a UInt64 from a network buffer using network byte order.

Declaration
public static ulong ParseUInt64(byte[] buffer, int posn)
Parameters
Type Name Description
System.Byte[] buffer

The buffer to parse the value from.

System.Int32 posn

The position in the buffer to start the parse from.

Returns
Type Description
System.UInt64

A UInt64 value.

| Improve this Doc View Source

ToBuffer(UInt16, Byte[], Int32)

Writes a UInt16 value to a network buffer using network byte order.

Declaration
public static void ToBuffer(ushort val, byte[] buffer, int posn)
Parameters
Type Name Description
System.UInt16 val

The value to write to the buffer.

System.Byte[] buffer

The buffer to write the value to.

System.Int32 posn

The start position in the buffer to write the value at.

| Improve this Doc View Source

ToBuffer(UInt32, Byte[], Int32)

Writes a UInt32 value to a network buffer using network byte order.

Declaration
public static void ToBuffer(uint val, byte[] buffer, int posn)
Parameters
Type Name Description
System.UInt32 val

The value to write to the buffer.

System.Byte[] buffer

The buffer to write the value to.

System.Int32 posn

The start position in the buffer to write the value at.

| Improve this Doc View Source

ToBuffer(UInt64, Byte[], Int32)

Writes a UInt64 value to a network buffer using network byte order.

Declaration
public static void ToBuffer(ulong val, byte[] buffer, int posn)
Parameters
Type Name Description
System.UInt64 val

The value to write to the buffer.

System.Byte[] buffer

The buffer to write the value to.

System.Int32 posn

The start position in the buffer to write the value at.

Extension Methods

JSONWriter.ToJson(Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX