Renci.SshNet.Common.SshDataStream.ReadBinary C# (CSharp) Method

ReadBinary() public method

Reads a byte array from the SSH data stream.
public ReadBinary ( ) : byte[]
return byte[]
        public byte[] ReadBinary()
        {
            var length = ReadUInt32();

            if (length > int.MaxValue)
            {
                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Data longer than {0} is not supported.", int.MaxValue));
            }

            return ReadBytes((int)length);
        }

Usage Example

Beispiel #1
0
 /// <summary>
 /// Reads next data type as byte array from internal buffer.
 /// </summary>
 /// <returns>
 /// The bytes read.
 /// </returns>
 protected byte[] ReadBinary()
 {
     return(_stream.ReadBinary());
 }