Exemple #1
0
        /// <summary>
        /// Return all bytes from current stream position to the end of the stream
        /// </summary>
        public static byte[] ReadAllBytes(Stream stream)
        {
            MemoryStream temp = new MemoryStream();

            ByteUtils.CopyStream(stream, temp);
            return(temp.ToArray());
        }
Exemple #2
0
        public static byte[] ReadBytes(Stream stream, int count)
        {
            MemoryStream temp = new MemoryStream();

            ByteUtils.CopyStream(stream, temp, count);
            return(temp.ToArray());
        }