Class BitStringArrayHandler
A special handler for arrays of bit strings. Differs from the standard array handlers in that it returns arrays of bool for BIT(1) and arrays of BitArray otherwise (just like the scalar BitStringHandler does).
Inherited Members
Namespace: Npgsql.TypeHandlers
Assembly: Npgsql.dll
Syntax
public class BitStringArrayHandler : ArrayHandler<BitArray>
Remarks
The type handler API allows customizing Npgsql's behavior in powerful ways. However, although it is public, it should be considered somewhat unstable, and may change in breaking ways, including in non-major releases. Use it at your own risk.
Constructors
BitStringArrayHandler(PostgresType, BitStringHandler)
Declaration
public BitStringArrayHandler(PostgresType postgresType, BitStringHandler elementHandler)
Parameters
Type | Name | Description |
---|---|---|
PostgresType | postgresType | |
BitStringHandler | elementHandler |
Methods
Read<TAny>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
Reads a value of type TAny
with the given length from the provided buffer,
using either sync or async I/O.
Declaration
protected override ValueTask<TAny> Read<TAny>(NpgsqlReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlReadBuffer | buf | The buffer from which to read. |
System.Int32 | len | The byte length of the value. The buffer might not contain the full length, requiring I/O to be performed. |
System.Boolean | async | If I/O is required to read the full length of the value, whether it should be performed synchronously or asynchronously. |
FieldDescription | fieldDescription | Additional PostgreSQL information about the type, such as the length in varchar(30). |
Returns
Type | Description |
---|---|
ValueTask<TAny> | The fully-read value. |
Type Parameters
Name | Description |
---|---|
TAny |