Table of Contents

Class NpgsqlWriteBuffer

Namespace
Npgsql
Assembly
Npgsql.dll

A buffer used by Npgsql to write data to the socket efficiently. Provides methods which encode different values types and tracks the current position.

public sealed class NpgsqlWriteBuffer
Inheritance
NpgsqlWriteBuffer
Inherited Members

Properties

WriteSpaceLeft

public int WriteSpaceLeft { get; }

Property Value

int

Methods

Flush(bool)

public Task Flush(bool async)

Parameters

async bool

Returns

Task

GetStream()

public Stream GetStream()

Returns

Stream

WriteByte(byte)

public void WriteByte(byte value)

Parameters

value byte

WriteBytes(byte[], int, int)

public void WriteBytes(byte[] buf, int offset, int count)

Parameters

buf byte[]
offset int
count int

WriteBytes(ReadOnlySpan<byte>)

public void WriteBytes(ReadOnlySpan<byte> buf)

Parameters

buf ReadOnlySpan<byte>

WriteBytesRaw(byte[], bool)

public Task WriteBytesRaw(byte[] bytes, bool async)

Parameters

bytes byte[]
async bool

Returns

Task

WriteDouble(double)

public void WriteDouble(double value)

Parameters

value double

WriteDouble(double, bool)

public void WriteDouble(double value, bool littleEndian)

Parameters

value double
littleEndian bool

WriteInt16(short)

public void WriteInt16(short value)

Parameters

value short

WriteInt16(short, bool)

public void WriteInt16(short value, bool littleEndian)

Parameters

value short
littleEndian bool

WriteInt32(int)

public void WriteInt32(int value)

Parameters

value int

WriteInt32(int, bool)

public void WriteInt32(int value, bool littleEndian)

Parameters

value int
littleEndian bool

WriteInt64(long)

public void WriteInt64(long value)

Parameters

value long

WriteInt64(long, bool)

public void WriteInt64(long value, bool littleEndian)

Parameters

value long
littleEndian bool

WriteNullTerminatedString(string)

public void WriteNullTerminatedString(string s)

Parameters

s string

WriteSByte(sbyte)

public void WriteSByte(sbyte value)

Parameters

value sbyte

WriteSingle(float)

public void WriteSingle(float value)

Parameters

value float

WriteSingle(float, bool)

public void WriteSingle(float value, bool littleEndian)

Parameters

value float
littleEndian bool

WriteString(string, int)

public void WriteString(string s, int len = 0)

Parameters

s string
len int

WriteString(string, int, bool)

public Task WriteString(string s, int byteLen, bool async)

Parameters

s string
byteLen int
async bool

Returns

Task

WriteString(string, int, int, bool)

public Task WriteString(string s, int charLen, int byteLen, bool async)

Parameters

s string
charLen int
byteLen int
async bool

Returns

Task

WriteUInt16(ushort)

public void WriteUInt16(ushort value)

Parameters

value ushort

WriteUInt16(ushort, bool)

public void WriteUInt16(ushort value, bool littleEndian)

Parameters

value ushort
littleEndian bool

WriteUInt32(uint)

public void WriteUInt32(uint value)

Parameters

value uint

WriteUInt32(uint, bool)

public void WriteUInt32(uint value, bool littleEndian)

Parameters

value uint
littleEndian bool

WriteUInt64(ulong)

public void WriteUInt64(ulong value)

Parameters

value ulong

WriteUInt64(ulong, bool)

public void WriteUInt64(ulong value, bool littleEndian)

Parameters

value ulong
littleEndian bool