2015년 9월 21일 월요일

[ C# ] stream에서 byte array만들기

[ C# ]  stream에서 byte array만들기
public static byte[] ReadFully(Stream input)
{
    byte[] buffer = new byte[16*1024];
    using (MemoryStream ms = new MemoryStream())
    {
        int read;
        while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
        {
            ms.Write(buffer, 0, read);
        }
        return ms.ToArray();
    }
}

http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream

댓글 1개:

  1. Find The Best Casino & Slots, Blackjack, & more - DrmCAD
    Looking 제주 출장안마 for the best casino games & slots, blackjack, and more? We 속초 출장마사지 have 구리 출장안마 the info you need 세종특별자치 출장마사지 before 화성 출장마사지 you play.

    답글삭제