Microsoft.SqlServer.TDS.TDSPacketHeader.Inflate C# (CSharp) 메소드

Inflate() 공개 메소드

Inflate TDS packet from the stream
public Inflate ( Stream source ) : bool
source System.IO.Stream Source of data
리턴 bool
        public bool Inflate(Stream source)
        {
            // Check if inflation is complete
            if (_inflationOffset < Size)
            {
                // Calculate remaining bytes
                int packetHeaderLeft = Size - _inflationOffset;

                // Read the rest of the packet header
                int packetHeaderRead = source.Read(_data, _inflationOffset, packetHeaderLeft);

                // Update offset
                _inflationOffset += (ushort)packetHeaderRead;
            }

            // Tell caller if inflation is complete
            return _inflationOffset >= Size;
        }
    }