コード例 #1
0
        public static byte[] ToArray(Stream stream, int bufferSize)
        {
            MemoryStream memoryStream = stream as MemoryStream;

            if (memoryStream == null)
            {
                memoryStream = new MemoryStream();
                StreamUtils.PumpStream(stream, memoryStream, bufferSize);
            }
            return(memoryStream.ToArray());
        }
コード例 #2
0
 public static void PumpStream(Stream inputStream, Stream outputStream)
 {
     StreamUtils.PumpStream(inputStream, outputStream, 65536);
 }