Search Results for

    Show / Hide Table of Contents

    Class NpgsqlReadBuffer

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

    Inheritance
    Object
    NpgsqlReadBuffer
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Npgsql
    Assembly: Npgsql.dll
    Syntax
    public sealed class NpgsqlReadBuffer

    Properties

    | Improve this Doc

    Connection

    Declaration
    public NpgsqlConnection Connection { get; }
    Property Value
    Type Description
    NpgsqlConnection

    Methods

    | Improve this Doc

    Ensure(Int32, Boolean)

    Ensures that count bytes are available in the buffer, and if not, reads from the socket until enough is available.

    Declaration
    public Task Ensure(int count, bool async)
    Parameters
    Type Name Description
    Int32 count
    Boolean async
    Returns
    Type Description
    Task
    | Improve this Doc

    GetNullTerminatedBytes()

    Declaration
    public ReadOnlySpan<byte> GetNullTerminatedBytes()
    Returns
    Type Description
    ReadOnlySpan<Byte>
    | Improve this Doc

    GetStream(Int32, Boolean)

    Declaration
    public Stream GetStream(int len, bool canSeek)
    Parameters
    Type Name Description
    Int32 len
    Boolean canSeek
    Returns
    Type Description
    Stream
    | Improve this Doc

    ReadByte()

    Declaration
    public byte ReadByte()
    Returns
    Type Description
    Byte
    | Improve this Doc

    ReadBytes(Byte[], Int32, Int32)

    Declaration
    public void ReadBytes(byte[] output, int outputOffset, int len)
    Parameters
    Type Name Description
    Byte[] output
    Int32 outputOffset
    Int32 len
    | Improve this Doc

    ReadBytes(Byte[], Int32, Int32, Boolean)

    Declaration
    public ValueTask<int> ReadBytes(byte[] output, int outputOffset, int len, bool async)
    Parameters
    Type Name Description
    Byte[] output
    Int32 outputOffset
    Int32 len
    Boolean async
    Returns
    Type Description
    ValueTask<Int32>
    | Improve this Doc

    ReadBytes(Span<Byte>)

    Declaration
    public void ReadBytes(Span<byte> output)
    Parameters
    Type Name Description
    Span<Byte> output
    | Improve this Doc

    ReadChars(Int32)

    Declaration
    public char[] ReadChars(int byteLen)
    Parameters
    Type Name Description
    Int32 byteLen
    Returns
    Type Description
    Char[]
    | Improve this Doc

    ReadDouble()

    Declaration
    public double ReadDouble()
    Returns
    Type Description
    Double
    | Improve this Doc

    ReadDouble(Boolean)

    Declaration
    public double ReadDouble(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    Double
    | Improve this Doc

    ReadInt16()

    Declaration
    public short ReadInt16()
    Returns
    Type Description
    Int16
    | Improve this Doc

    ReadInt16(Boolean)

    Declaration
    public short ReadInt16(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    Int16
    | Improve this Doc

    ReadInt32()

    Declaration
    public int ReadInt32()
    Returns
    Type Description
    Int32
    | Improve this Doc

    ReadInt32(Boolean)

    Declaration
    public int ReadInt32(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    Int32
    | Improve this Doc

    ReadInt64()

    Declaration
    public long ReadInt64()
    Returns
    Type Description
    Int64
    | Improve this Doc

    ReadInt64(Boolean)

    Declaration
    public long ReadInt64(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    Int64
    | Improve this Doc

    ReadMemory(Int32)

    Declaration
    public ReadOnlyMemory<byte> ReadMemory(int len)
    Parameters
    Type Name Description
    Int32 len
    Returns
    Type Description
    ReadOnlyMemory<Byte>
    | Improve this Doc

    ReadNullTerminatedString()

    Seeks the first null terminator (\0) and returns the string up to it. The buffer must already contain the entire string and its terminator.

    Declaration
    public string ReadNullTerminatedString()
    Returns
    Type Description
    String
    | Improve this Doc

    ReadNullTerminatedStringRelaxed()

    Seeks the first null terminator (\0) and returns the string up to it. The buffer must already contain the entire string and its terminator. If any character could not be decoded, a question mark character is returned instead of throwing an exception.

    Declaration
    public string ReadNullTerminatedStringRelaxed()
    Returns
    Type Description
    String
    | Improve this Doc

    ReadSByte()

    Declaration
    public sbyte ReadSByte()
    Returns
    Type Description
    SByte
    | Improve this Doc

    ReadSingle()

    Declaration
    public float ReadSingle()
    Returns
    Type Description
    Single
    | Improve this Doc

    ReadSingle(Boolean)

    Declaration
    public float ReadSingle(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    Single
    | Improve this Doc

    ReadSpan(Int32)

    Declaration
    public ReadOnlySpan<byte> ReadSpan(int len)
    Parameters
    Type Name Description
    Int32 len
    Returns
    Type Description
    ReadOnlySpan<Byte>
    | Improve this Doc

    ReadString(Int32)

    Declaration
    public string ReadString(int byteLen)
    Parameters
    Type Name Description
    Int32 byteLen
    Returns
    Type Description
    String
    | Improve this Doc

    ReadUInt16()

    Declaration
    public ushort ReadUInt16()
    Returns
    Type Description
    UInt16
    | Improve this Doc

    ReadUInt16(Boolean)

    Declaration
    public ushort ReadUInt16(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    UInt16
    | Improve this Doc

    ReadUInt32()

    Declaration
    public uint ReadUInt32()
    Returns
    Type Description
    UInt32
    | Improve this Doc

    ReadUInt32(Boolean)

    Declaration
    public uint ReadUInt32(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    UInt32
    | Improve this Doc

    ReadUInt64()

    Declaration
    public ulong ReadUInt64()
    Returns
    Type Description
    UInt64
    | Improve this Doc

    ReadUInt64(Boolean)

    Declaration
    public ulong ReadUInt64(bool littleEndian)
    Parameters
    Type Name Description
    Boolean littleEndian
    Returns
    Type Description
    UInt64
    | Improve this Doc

    Skip(Int64, Boolean)

    Skip a given number of bytes.

    Declaration
    public async Task Skip(long len, bool async)
    Parameters
    Type Name Description
    Int64 len
    Boolean async
    Returns
    Type Description
    Task
    • Improve this Doc
    In This Article
    Back to top © Copyright 2021 The Npgsql Development Team