Version: 2017.1

NetworkWriter

class in UnityEngine.Networking

매뉴얼로 전환

설명

General purpose serializer for UNET (for serializing data to byte arrays).

변수

PositionThe current position of the internal buffer.

생성자

NetworkWriterCreates a new NetworkWriter object.

Public 함수

AsArrayReturns the internal array of bytes the writer is using. This is NOT a copy.
FinishMessageThis fills out the size header of a message begun with StartMessage(), so that it can be send using Send() functions.
SeekZeroSeeks to the start of the internal buffer.
StartMessageThis begins a new message, which should be completed with FinishMessage() once the payload has been written.
ToArrayReturns a copy of internal array of bytes the writer is using, it copies only the bytes used.
WriteThis writes a reference to an object, value, buffer or network message, together with a NetworkIdentity component to the stream.
WriteBytesAndSizeThis writes a 16-bit count and a array of bytes of that length to the stream.
WriteBytesFullThis writes a 16-bit count and an array of bytes of that size to the stream.
WritePackedUInt32This writes the 32-bit value to the stream using variable-length-encoding.
WritePackedUInt64This writes the 64-bit value to the stream using variable-length-encoding.