Your task is to implement the
byte[] BlockDecode(byte[] encoded)
function.
A starting point might be the following skeleton.
Since you do not provide any information so far on the block code, I can not provide any implementation for it... (see BlockDecode method body below).
static void Main(string[] args)
{
...
string inFilePath = ...;
string outFilePath = ...;
...
byte[] encoded = File.ReadAllBytes(inFilePath);
byte[] decoded = BlockDecode(encoded);
File.WriteAllBytes(outFilePath, decoded);
}
private static byte[] BlockDecode(byte[] encoded)
{
byte[] decoded = new byte[encoded.Length];
int decodedBytes = 0;
...
Array.Resize(ref decoded, decodedBytes);
return decoded;
}