System.IO.Stream.ReadByteArray(int)

Here are the examples of the csharp api System.IO.Stream.ReadByteArray(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

19 Source : StreamReadExtensions.cs
with Apache License 2.0
from DataAction

public static byte[] ReadNullableByteLengthPrefixedByteArray(this Stream stream)
        {
            var length = stream.ReadByte();

            if (length == 0)
            {
                return null;
            }

            return stream.ReadByteArray(length);
        }

19 Source : StreamReadExtensions.cs
with Apache License 2.0
from DataAction

public static byte[] ReadByteLengthPrefixedByteArray(this Stream stream)
        {
            var length = stream.ReadByte();

            if (length == 0)
            {
                return new byte[0];
            }

            return stream.ReadByteArray(length);
        }

19 Source : StreamReadExtensions.cs
with Apache License 2.0
from DataAction

public static byte[] ReadNullableUShortLengthPrefixedByteArray(this Stream stream)
        {
            var length = stream.ReadUShort();

            if (length == 0)
            {
                return null;
            }

            return stream.ReadByteArray(length);
        }

19 Source : StreamReadExtensions.cs
with Apache License 2.0
from DataAction

public static byte[] ReadNullableIntLengthPrefixedByteArray(this Stream stream)
        {
            var length = stream.ReadInt();

            if (length == 0)
            {
                return null;
            }

            return stream.ReadByteArray(length);
        }