예제 #1
0
        void ReadHeader()
        {
            _leftToReadInDataMsg = _connector.ReadExpecting <CopyDataMessage>().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;
        }
 internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
 {
     PID                   = buf.ReadInt32();
     Condition             = buf.ReadNullTerminatedString();
     AdditionalInformation = buf.ReadNullTerminatedString();
 }