private static unsafe Guid ReadBinaryGuid(byte *data) { var a = BinaryBuffer.ReadIntNetworkUnsafe(data); var b = BinaryBuffer.ReadShortNetworkUnsafe(&data[4]); var c = BinaryBuffer.ReadShortNetworkUnsafe(&data[6]); return(new Guid(a, b, c, data[8], data[9], data[10], data[11], data[12], data[13], data[14], data[15])); }
public override unsafe IReadOnlyList <long> DecodeBinaryArray( byte *data, int length, int count, PostgresClientState state) { const int dataLength = 8; var result = new long[count]; var resultIndex = 0; fixed(long *resultPtr = result) { for (var i = 0; i < length; i += dataLength) { resultPtr[resultIndex++] = BinaryBuffer .ReadShortNetworkUnsafe(&data[i]); } } return(result); }
public override short DecodeBinary(DataRow row, PostgresClientState state) { PostgresTypeConverter.DemandDataLength(row, 2); return(BinaryBuffer.ReadShortNetworkUnsafe(row.Data, 0)); }