Tao.Sdl SDK Documentation

SdlNet.SDLNet_Write16 Method 

Put the 16bit (a short on 32bit systems) value into the data buffer area in network byte order.

[Visual Basic]
Public Shared Sub SDLNet_Write16( _
   ByVal value As Short, _
   ByVal area As IntPtr _
)
[C#]
public static void SDLNet_Write16(
   short value,
   IntPtr area
);

Parameters

value
The 16bit number to put into the area buffer.
area
The pointer into a data buffer, at which to put the number.

Remarks

This helps avoid byte order differences between two systems that are talking over the network. The value can be a signed number, the unsigned parameter type doesn't affect the data. The area pointer need not be at the beginning of a buffer, but must have at least 2 bytes of space left, including the byte currently pointed at.

Binds to C-function call in SDL_error.h:

extern DECLSPEC void SDLCALL SDLNet_Write16(Uint16 value, void *area)

Example

            // put my number into a data buffer to prepare for
            // sending to a remote host
            char data[1024];
            Sint16 number=12345;
            SDLNet_Write16((Uint16)number,data);
            

See Also

SdlNet Class | Tao.Sdl Namespace | SDLNet_Write32 | SDLNet_Read16