Net |
public class NetDataWriter
The NetDataWriter type exposes the following members.
| Name | Description | |
|---|---|---|
| NetDataWriter | Initializes a new instance of the NetDataWriter class | |
| NetDataWriter(Boolean) | Initializes a new instance of the NetDataWriter class | |
| NetDataWriter(Boolean, Int32) | Initializes a new instance of the NetDataWriter class |
| Name | Description | |
|---|---|---|
| Capacity | Gets the total capacity of the internal Byte buffer. | |
| Data | Gets the underlying Byte array used by this writer. | |
| Length | Gets the current number of Bytes written to the buffer. |
| Name | Description | |
|---|---|---|
| AsReadOnlySpan | Returns a ReadOnlySpanT representing the currently used portion of the internal buffer. | |
| CopyData | Creates a Byte array containing the current data from the internal buffer. | |
| EnsureFit | Ensures the internal buffer can accommodate additionalSize more Bytes. | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| FromBytes(SpanByte) | Creates NetDataWriter from the given bytes. | |
| FromBytes(Byte, Boolean) | Creates NetDataWriter from existing ByteArray | |
| FromBytes(Byte, Int32, Int32) | Creates NetDataWriter from existing ByteArray (always copied data) | |
| FromString | Creates a new NetDataWriter and serializes a String into it. | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| Put(Boolean) | Serializes a Boolean value as a single Byte. | |
| Put(Byte) | Serializes a Byte value. | |
| Put(Byte) | Serializes an entire Byte array. | |
| Put(Char) | Serializes a Char value as a UInt16. | |
| Put(Double) | Serializes a Double value. | |
| Put(Guid) | Serializes a Guid value. | |
| Put(Int16) | Serializes a Int16 value. | |
| Put(Int32) | Serializes an Int32 value. | |
| Put(Int64) | Serializes a Int64 value. | |
| Put(IPEndPoint) | Serializes an IPEndPoint. | |
| Put(ReadOnlySpanByte) | Serializes a ReadOnlySpanT of Bytes to the internal buffer. | |
| Put(SByte) | Serializes an SByte value. | |
| Put(Single) | Serializes a Single value. | |
| Put(UInt16) | Serializes a UInt16 value. | |
| Put(UInt32) | Serializes a UInt32 value. | |
| Put(UInt64) | Serializes a UInt64 value. | |
| Put(String, Int32) | Serializes a string using a 2-byte UInt16 length header. | |
| Put(Byte, Int32, Int32) | Serializes a segment of a Byte array. | |
| PutT(T) | Serializes an object implementing INetSerializable. | |
| PutArray(Boolean) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Double) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Int16) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Int32) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Int64) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Single) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(String) | Serializes an array of String values. | |
| PutArray(UInt16) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(UInt32) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(UInt64) | Serializes an array of unmanaged values to the internal buffer. | |
| PutArray(Array, Int32) | Serializes an Array prefixed with a 2-byte UInt16 length. | |
| PutArray(String, Int32) | Serializes an array of String values with a maximum length constraint per element. | |
| PutArrayT(T) | Serializes an array of objects implementing INetSerializable. | |
| PutBytesWithLength(Byte) | Serializes a Byte array prefixed with its UInt16 length. | |
| PutBytesWithLength(Byte, Int32, UInt16) | Serializes a segment of a Byte array prefixed with its UInt16 length. | |
| PutEnumT |
Writes an enum value of type T to the internal data buffer at the current position. Automatically resizes the buffer if _autoResize is enabled. Advances the position by the size of T. | |
| PutLargeString | Serializes a String using a 4-byte Int32 length header. | |
| PutNullableUnmanagedT |
Writes a nullable value of type T into the internal byte buffer at the current position,
first writing a Boolean indicating whether the value is present,
and then writing the value itself if it exists. Advances the position by 1 byte for the presence flag plus the size of T if the value is present. | |
| PutSBytesWithLength(SByte) | Serializes an SByte array prefixed with its UInt16 length. | |
| PutSBytesWithLength(SByte, Int32, UInt16) | Serializes a segment of an SByte array prefixed with its UInt16 length. | |
| PutSpanT | Serializes a SpanT of unmanaged values to the internal buffer. | |
| PutUnmanagedT | Writes a value of type T into the internal byte buffer at the current position, advancing the position by the size of T. | |
| PutUnmanagedArrayT | Serializes an array of unmanaged values. | |
| Reset | Resets the _position to 0, effectively clearing the buffer for reuse. | |
| Reset(Int32) | Resets the _position to 0 and ensures the internal buffer has at least the specified size. | |
| ResizeIfNeed | Ensures the internal buffer is at least newSize. | |
| SetPosition | Sets position of NetDataWriter to rewrite previous values | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| MethodInvoke |
Calls the object method by name.
(Defined by ObjectEx) | |
| PropertyGet |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertyGetT |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertySet |
Sets the value of the object property by name.
(Defined by ObjectEx) |