public byte[] Encode(byte[] data) { if (enc == null) { return(data); } byte[] result = new byte[data.Length]; for (int i = 0; i < data.Length; i++) { result[i] = enc.Encode(data[i]); } return(result); }
public byte[] Decode(byte[] buffer, int length) { byte[] data = new byte[length]; Buffer.BlockCopy(buffer, 0, data, 0, length); if (dec == null || mppc == null) { return(data); } foreach (byte bt in data) { decBuffer.WriteBytes(mppc .Unpack(dec .Encode(bt))); } data = decBuffer.GetBytes(); decBuffer.Clear(); return(data); }