Class NpgsqlWriteBuffer
A buffer used by Npgsql to write data to the socket efficiently.
Provides methods which encode different values types and tracks the current position.
Inheritance
System.Object
NpgsqlWriteBuffer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlWriteBuffer
Properties
WriteSpaceLeft
Declaration
public int WriteSpaceLeft { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
Flush(Boolean)
Declaration
public Task Flush(bool async)
Parameters
Type |
Name |
Description |
System.Boolean |
async |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
GetStream()
Declaration
public Stream GetStream()
Returns
Type |
Description |
System.IO.Stream |
|
WriteByte(Byte)
Declaration
public void WriteByte(byte value)
Parameters
Type |
Name |
Description |
System.Byte |
value |
|
WriteBytes(Byte[], Int32, Int32)
Declaration
public void WriteBytes(byte[] buf, int offset, int count)
Parameters
Type |
Name |
Description |
System.Byte[] |
buf |
|
System.Int32 |
offset |
|
System.Int32 |
count |
|
WriteBytes(ReadOnlySpan<Byte>)
Declaration
public void WriteBytes(ReadOnlySpan<byte> buf)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
buf |
|
WriteBytesRaw(Byte[], Boolean)
Declaration
public Task WriteBytesRaw(byte[] bytes, bool async)
Parameters
Type |
Name |
Description |
System.Byte[] |
bytes |
|
System.Boolean |
async |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
WriteDouble(Double)
Declaration
public void WriteDouble(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
WriteDouble(Double, Boolean)
Declaration
public void WriteDouble(double value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
System.Boolean |
littleEndian |
|
WriteInt16(Int16)
Declaration
public void WriteInt16(short value)
Parameters
Type |
Name |
Description |
System.Int16 |
value |
|
WriteInt16(Int16, Boolean)
Declaration
public void WriteInt16(short value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.Int16 |
value |
|
System.Boolean |
littleEndian |
|
WriteInt32(Int32)
Declaration
public void WriteInt32(int value)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
WriteInt32(Int32, Boolean)
Declaration
public void WriteInt32(int value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.Int32 |
value |
|
System.Boolean |
littleEndian |
|
WriteInt64(Int64)
Declaration
public void WriteInt64(long value)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
WriteInt64(Int64, Boolean)
Declaration
public void WriteInt64(long value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.Int64 |
value |
|
System.Boolean |
littleEndian |
|
WriteNullTerminatedString(String)
Declaration
public void WriteNullTerminatedString(string s)
Parameters
Type |
Name |
Description |
System.String |
s |
|
WriteSByte(SByte)
Declaration
public void WriteSByte(sbyte value)
Parameters
Type |
Name |
Description |
System.SByte |
value |
|
WriteSingle(Single)
Declaration
public void WriteSingle(float value)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
WriteSingle(Single, Boolean)
Declaration
public void WriteSingle(float value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.Single |
value |
|
System.Boolean |
littleEndian |
|
WriteString(String, Int32)
Declaration
public void WriteString(string s, int len = 0)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.Int32 |
len |
|
WriteString(String, Int32, Boolean)
Declaration
public Task WriteString(string s, int byteLen, bool async)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.Int32 |
byteLen |
|
System.Boolean |
async |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
WriteString(String, Int32, Int32, Boolean)
Declaration
public Task WriteString(string s, int charLen, int byteLen, bool async)
Parameters
Type |
Name |
Description |
System.String |
s |
|
System.Int32 |
charLen |
|
System.Int32 |
byteLen |
|
System.Boolean |
async |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
WriteUInt16(UInt16)
Declaration
public void WriteUInt16(ushort value)
Parameters
Type |
Name |
Description |
System.UInt16 |
value |
|
WriteUInt16(UInt16, Boolean)
Declaration
public void WriteUInt16(ushort value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.UInt16 |
value |
|
System.Boolean |
littleEndian |
|
WriteUInt32(UInt32)
Declaration
public void WriteUInt32(uint value)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
|
WriteUInt32(UInt32, Boolean)
Declaration
public void WriteUInt32(uint value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.UInt32 |
value |
|
System.Boolean |
littleEndian |
|
WriteUInt64(UInt64)
Declaration
public void WriteUInt64(ulong value)
Parameters
Type |
Name |
Description |
System.UInt64 |
value |
|
WriteUInt64(UInt64, Boolean)
Declaration
public void WriteUInt64(ulong value, bool littleEndian)
Parameters
Type |
Name |
Description |
System.UInt64 |
value |
|
System.Boolean |
littleEndian |
|