Answers for "c# byte string to stream"

C#
1

stream to byte array c#

public static byte[] GetBytes(Stream stream)
  {
   	var bytes = new byte[stream.Length];
   	stream.Seek(0, SeekOrigin.Begin);
   	stream.ReadAsync(bytes, 0, bytes.Length);
   	stream.Dispose();
   	return bytes;
  }
Posted by: Guest on November-25-2021
0

c# write byte

static void Write(Stream s, Byte[] bytes)
{
    using (var writer = new BinaryWriter(s))
    {
        writer.Write(bytes);
    }
}
Posted by: Guest on January-01-1970

C# Answers by Framework

Browse Popular Code Answers by Language