Convert byte array To Stream - CSharp System

CSharp examples for System:Byte Array

Description

Convert byte array To Stream

Demo Code


using System.IO;/*  ww  w  .jav  a 2s . com*/
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

public class Main{

        public static Stream ToStream(this byte[] bytes)
        {
            Stream stream = new MemoryStream(bytes);
            stream.Seek(0, SeekOrigin.Begin);
            return stream;
        }
}

Related Tutorials