コード例 #1
0
 internal override DataRowMessage Load(ReadBuffer buf)
 {
     buf.Ensure(sizeof(short));
     NumColumns = buf.ReadInt16();
     Buffer = buf;
     Column = -1;
     ColumnLen = -1;
     PosInColumn = 0;
     return this;
 }
コード例 #2
0
 internal NpgsqlRawCopyStream(NpgsqlConnector connector, string copyCommand)
 {
     _connector = connector;
     _readBuf = connector.ReadBuffer;
     _writeBuf = connector.WriteBuffer;
     _connector.SendQuery(copyCommand);
     var msg = _connector.ReadMessage(DataRowLoadingMode.NonSequential);
     switch (msg.Code)
     {
     case BackendMessageCode.CopyInResponse:
         var copyInResponse = (CopyInResponseMessage) msg;
         IsBinary = copyInResponse.IsBinary;
         _canWrite = true;
         break;
     case BackendMessageCode.CopyOutResponse:
         var copyOutResponse = (CopyOutResponseMessage) msg;
         IsBinary = copyOutResponse.IsBinary;
         _canRead = true;
         break;
     default:
         throw _connector.UnexpectedMessageReceived(msg.Code);
     }
 }
コード例 #3
0
 public abstract void PrepareRead(ReadBuffer buf, int len, FieldDescription fieldDescription = null);
コード例 #4
0
 internal NpgsqlNotificationEventArgs(ReadBuffer buf)
 {
     PID                   = buf.ReadInt32();
     Condition             = buf.ReadNullTerminatedString();
     AdditionalInformation = buf.ReadNullTerminatedString();
 }
コード例 #5
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 TPsv ISimpleTypeHandler <TPsv> .Read(ReadBuffer buf, int len, [CanBeNull] FieldDescription fieldDescription)
 => ReadPsv(buf, len, fieldDescription);
コード例 #6
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 internal override async ValueTask <object> ReadPsvAsObject(ReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null)
 => await Read <TPsv>(buf, len, async, fieldDescription);
コード例 #7
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 internal virtual ValueTask <object> ReadPsvAsObject(ReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null)
 => ReadAsObject(buf, len, async, fieldDescription);
コード例 #8
0
 internal virtual object ReadPsvAsObjectFully(ReadBuffer buf, int len, FieldDescription fieldDescription = null)
 {
     return(ReadValueAsObjectFully(buf, len, fieldDescription));
 }
コード例 #9
0
 internal abstract Task <T> ReadFullyAsync <T>(ReadBuffer buf, int len, CancellationToken cancellationToken, FieldDescription fieldDescription = null);
コード例 #10
0
ファイル: PostgresNotice.cs プロジェクト: zloom/npgsql
 internal PostgresNotice(ReadBuffer buf)
 {
     _msg = new ErrorOrNoticeMessage(buf);
 }
コード例 #11
0
 void Cleanup()
 {
     _connector = null;
     _readBuf = null;
     _writeBuf = null;
     _isDisposed = true;
 }
コード例 #12
0
ファイル: ReadBuffer.cs プロジェクト: ArsenShnurkov/npgsql
 internal void CopyTo(ReadBuffer other)
 {
     Contract.Assert(other.Size - other._filledBytes >= ReadBytesLeft);
     Array.Copy(_buf, ReadPosition, other._buf, other._filledBytes, ReadBytesLeft);
     other._filledBytes += ReadBytesLeft;
 }
コード例 #13
0
ファイル: ReadBuffer.cs プロジェクト: ArsenShnurkov/npgsql
        internal ReadBuffer EnsureOrAllocateTemp(int count)
        {
            if (count <= Size) {
                Ensure(count);
                return this;
            }

            // Worst case: our buffer isn't big enough. For now, allocate a new buffer
            // and copy into it
            // TODO: Optimize with a pool later?
            var tempBuf = new ReadBuffer(Connector, Underlying, count, TextEncoding);
            CopyTo(tempBuf);
            Clear();
            tempBuf.Ensure(count);
            return tempBuf;
        }
コード例 #14
0
 public void SetUp()
 {
     Underlying = new MemoryStream();
     ReadBuffer = new ReadBuffer(null, Underlying, ReadBuffer.DefaultBufferSize, PGUtil.UTF8Encoding);
 }
コード例 #15
0
 internal NpgsqlNotificationEventArgs(ReadBuffer buf)
 {
     PID = buf.ReadInt32();
     Condition = buf.ReadNullTerminatedString();
     AdditionalInformation = buf.ReadNullTerminatedString();
 }
コード例 #16
0
 public override void PrepareRead(ReadBuffer buf, int len, FieldDescription fieldDescription = null)
 {
     Contract.Requires(buf != null);
 }
コード例 #17
0
 internal abstract T ReadFully <T>(ReadBuffer buf, int len, FieldDescription fieldDescription = null);
コード例 #18
0
 internal void CopyTo(ReadBuffer other)
 {
     Contract.Assert(other.Size - other._filledBytes >= ReadBytesLeft);
     Array.Copy(_buf, ReadPosition, other._buf, other._filledBytes, ReadBytesLeft);
     other._filledBytes += ReadBytesLeft;
 }
コード例 #19
0
 internal abstract object ReadValueAsObjectFully(ReadBuffer buf, int len, FieldDescription fieldDescription = null);
コード例 #20
0
 internal PostgresException(ReadBuffer buf)
 {
     _msg = new ErrorOrNoticeMessage(buf);
 }
コード例 #21
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 internal abstract ValueTask <object> ReadAsObject(ReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null);
コード例 #22
0
 public object ReadAsObject(ReadBuffer buf, int len, FieldDescription fieldDescription = null)
 {
     return(Read(buf, len, fieldDescription));
 }
コード例 #23
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 public abstract T Read(ReadBuffer buf, int len, FieldDescription fieldDescription = null);
コード例 #24
0
 internal override object ReadPsvAsObjectFully(ReadBuffer buf, int len, FieldDescription fieldDescription = null)
 {
     return(ReadFully <TPsv>(buf, len, fieldDescription));
 }
コード例 #25
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 internal abstract TPsv ReadPsv(ReadBuffer buf, int len, FieldDescription fieldDescription = null);
コード例 #26
0
 TPsv ISimpleTypeHandler <TPsv> .Read(ReadBuffer buf, int len, FieldDescription fieldDescription)
 {
     return(ReadPsv(buf, len, fieldDescription));
 }
コード例 #27
0
ファイル: TypeHandler.cs プロジェクト: hitenjava/Npgsql
 public abstract ValueTask <T> Read(ReadBuffer buf, int len, bool async, FieldDescription fieldDescription = null);
コード例 #28
0
ファイル: ReadBuffer.cs プロジェクト: hitenjava/Npgsql
 internal void CopyTo(ReadBuffer other)
 {
     Debug.Assert(other.Size - other._filledBytes >= ReadBytesLeft);
     Array.Copy(Buffer, ReadPosition, other.Buffer, other._filledBytes, ReadBytesLeft);
     other._filledBytes += ReadBytesLeft;
 }