Org.BouncyCastle.Crypto.Tls.TlsProtocolHandler.ReadApplicationData C# (CSharp) Метод

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

private ReadApplicationData ( byte buf, int offset, int len ) : int
buf byte
offset int
len int
Результат int
        internal int ReadApplicationData(byte[] buf, int offset, int len)
        {
            while (applicationDataQueue.Available == 0)
            {
                if (this.closed)
                {
                    /*
                    * We need to read some data.
                    */
                    if (this.failedWithError)
                    {
                        /*
                        * Something went terribly wrong, we should throw an IOException
                        */
                        throw new IOException(TLS_ERROR_MESSAGE);
                    }

                    /*
                    * Connection has been closed, there is no more data to read.
                    */
                    return 0;
                }

                SafeReadData();
            }
            len = System.Math.Min(len, applicationDataQueue.Available);
            applicationDataQueue.Read(buf, offset, len, 0);
            applicationDataQueue.RemoveData(len);
            return len;
        }