Class DataWriter
- Namespace
- nanoFramework.Device.Bluetooth
- Assembly
- nanoFramework.Device.Bluetooth.dll
Writes data to an output stream.
public class DataWriter : Buffer
- Inheritance
-
DataWriter
- Inherited Members
- Extension Methods
Constructors
DataWriter()
Creates and initializes a new instance of the data writer.
public DataWriter()
Methods
DetachBuffer()
Returns byte buffer of data in buffer
public Buffer DetachBuffer()
Returns
- Buffer
Buffer
MeasureString(string)
Gets the size of a string.
public uint MeasureString(string value)
Parameters
valuestringThe string.
Returns
- uint
The size of the string, in bytes.
WriteBoolean(bool)
Writes a Boolean value to the output stream.
public void WriteBoolean(bool value)
Parameters
valueboolThe value to write.
WriteBuffer(Buffer)
Writes a number of bytes from a buffer.
public void WriteBuffer(Buffer buffer)
Parameters
bufferBufferThe value to write.
WriteBuffer(Buffer, uint, uint)
Writes a range of bytes from a buffer to the output stream.
public void WriteBuffer(Buffer buffer, uint start, uint count)
Parameters
bufferBufferThe buffer.
startuintThe starting byte to be written.
countuintThe number of bytes to write.
WriteByte(byte)
Writes a byte value to the output stream.
public void WriteByte(byte value)
Parameters
valuebyteThe value to write.
WriteBytes(byte[])
Writes an array of byte values to the output stream.
public void WriteBytes(byte[] value)
Parameters
valuebyte[]The value to write.
WriteDateTime(DateTime)
Writes a date and time value to the output stream.
public void WriteDateTime(DateTime value)
Parameters
valueDateTimeThe value to write.
WriteDouble(double)
Writes a floating-point value to the output stream.
public void WriteDouble(double value)
Parameters
valuedoubleThe value to write.
WriteGuid(Guid)
Writes a GUID value to the output stream.
public void WriteGuid(Guid value)
Parameters
valueGuidThe value to write.
WriteInt16(short)
Writes a 16-bit integer value to the output stream.
public void WriteInt16(short value)
Parameters
valueshortThe value to write.
WriteInt32(int)
Writes a 32-bit integer value to the output stream.
public void WriteInt32(int value)
Parameters
valueintThe value to write.
WriteInt64(long)
Writes a 64-bit integer value to the output stream.
public void WriteInt64(long value)
Parameters
valuelongThe value to write.
WriteSingle(float)
Write a floating-point value to the output stream.
public void WriteSingle(float value)
Parameters
valuefloatThe value to write.
WriteString(string)
Writes a string value to the output stream.
public uint WriteString(string value)
Parameters
valuestringThe value to write.
Returns
- uint
The length of the string.
WriteTimeSpan(TimeSpan)
Writes a time interval value to the output stream.
public void WriteTimeSpan(TimeSpan value)
Parameters
valueTimeSpanThe value to write.
WriteUInt16(ushort)
Writes a 16-bit unsigned integer value to the output stream.
public void WriteUInt16(ushort value)
Parameters
valueushortThe value to write.
WriteUInt32(uint)
Writes a 32-bit unsigned integer value to the output stream.
public void WriteUInt32(uint value)
Parameters
valueuintThe value to write.
WriteUInt64(ulong)
Writes a 64-bit unsigned integer value to the output stream.
public void WriteUInt64(ulong value)
Parameters
valueulongThe value to write.
WriteUuid(Guid)
Writes a UUID value to the output stream using order expected for service UUIDs. The order of bytes is reverse of bytes when displayed.
public void WriteUuid(Guid value)
Parameters
valueGuidThe UUID value to write.
WriteUuid2(Guid)
Write a UUID value to the output stream using order expected by Beacon advertisements. The order of bytes is same as when displayed.
public void WriteUuid2(Guid value)
Parameters
valueGuid