Beispiel #1
0
        void ReadHeader()
        {
            _leftToReadInDataMsg = Expect <CopyDataMessage>(_connector.ReadMessage(), _connector).Length;
            var headerLen = NpgsqlRawCopyStream.BinarySignature.Length + 4 + 4;

            _buf.Ensure(headerLen);
            if (NpgsqlRawCopyStream.BinarySignature.Any(t => _buf.ReadByte() != t))
            {
                throw new NpgsqlException("Invalid COPY binary signature at beginning!");
            }
            var flags = _buf.ReadInt32();

            if (flags != 0)
            {
                throw new NotSupportedException("Unsupported flags in COPY operation (OID inclusion?)");
            }
            _buf.ReadInt32();   // Header extensions, currently unused
            _leftToReadInDataMsg -= headerLen;
        }
Beispiel #2
0
 internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
 {
     PID                   = buf.ReadInt32();
     Condition             = buf.ReadNullTerminatedString();
     AdditionalInformation = buf.ReadNullTerminatedString();
 }
Beispiel #3
0
 internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
 {
     PID     = buf.ReadInt32();
     Channel = buf.ReadNullTerminatedString();
     Payload = buf.ReadNullTerminatedString();
 }