System.ServiceModel.Http2Protocol.Http2Protocol.FillBuffer C# (CSharp) Метод

FillBuffer() приватный Метод

Fills the given buffer with bytes.
private FillBuffer ( byte buffer, int filledBytesCount ) : bool
buffer byte The buffer.
filledBytesCount int Already filled bytes count in buffer.
Результат bool
        private bool FillBuffer(byte[] buffer, int filledBytesCount)
        {
            int bytesFilledTotal = filledBytesCount;
            while (bytesFilledTotal < buffer.Length)
            {
                byte[] bf = new byte[buffer.Length - bytesFilledTotal];
                int bytesFilledAtOneStep = socket.Receive(bf);

                if (bytesFilledAtOneStep == -1)
                    return false;

                Buffer.BlockCopy(bf, 0, buffer, bytesFilledTotal, bf.Length);
                bytesFilledTotal += bytesFilledAtOneStep;
            }

            return true;
        }