/// <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()); }
public static byte[] ReadBytes(Stream stream, int count) { MemoryStream temp = new MemoryStream(); ByteUtils.CopyStream(stream, temp, count); return(temp.ToArray()); }