FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);
using (BinaryReader br = new BinaryReader(fs))
{
byte[] bytes = new byte[0];
using (MemoryStream test = new MemoryStream())
{
fs.CopyTo(test);
bytes = test.ToArray();
}
byte[] searchBytes = Encoding.UTF8.GetBytes("test");
List<long> positions = new List<long>();
foreach(long pos in Extensions.SearchStringInBytes(bytes, searchBytes))
{
positions.Add(pos - 4);
}
}
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read);
using (BinaryReader br = new BinaryReader(fs))
{
byte[] bytes = new byte[0];
using (MemoryStream test = new MemoryStream())
{
fs.CopyTo(test);
bytes = test.ToArray();
}
byte[] searchBytes = Encoding.UTF8.GetBytes("test");
List<long> positions = new List<long>();
foreach(long pos in Extensions.SearchStringInBytes(bytes, searchBytes))
{
positions.Add(pos - 4);
}
}