Org.BouncyCastle.Asn1.DefiniteLengthInputStream.ReadAllIntoByteArray C# (CSharp) Méthode

ReadAllIntoByteArray() private méthode

private ReadAllIntoByteArray ( byte buf ) : void
buf byte
Résultat void
        internal void ReadAllIntoByteArray(byte[] buf)
        {
            if (_remaining != buf.Length)
                throw new ArgumentException("buffer length not right for data");

            if ((_remaining -= Streams.ReadFully(_in, buf)) != 0)
                throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining);
            SetParentEofDetect(true);
        }

Usage Example

Exemple #1
0
        internal static byte[] GetBuffer(DefiniteLengthInputStream defIn, byte[][] tmpBuffers)
        {
            int remaining = defIn.GetRemaining();

            if (remaining >= tmpBuffers.Length)
            {
                return(defIn.ToArray());
            }
            byte[] buf = tmpBuffers[remaining];
            if (buf == null)
            {
                buf = tmpBuffers[remaining] = new byte[remaining];
            }
            defIn.ReadAllIntoByteArray(buf);
            return(buf);
        }
All Usage Examples Of Org.BouncyCastle.Asn1.DefiniteLengthInputStream::ReadAllIntoByteArray