Hello out there.
The problem is: I need to destuff a bytearray!

I've done this so far to stuff my byte[]:
HINT: A=BC, B=BD any other character is the same. The byteArray must start and end with A (flag)

---------------------------------------------------

public void send(byte[] buffer, int size)
{
byte[] lokalBuffer = new byte[2100];
lokalBuffer[0] = 'A';
int i = 1;
for(byte b : buffer)
{
if(b == 'A')
{
lokalBuffer[i]='B';
i++;
lokalBuffer[i]='C';
i++;
}
else if(b == 'B')
{
lokalBuffer[i]='B';
i++;
lokalBuffer[i]='D';
i++;
}
else{
lokalBuffer[i]=b;
i++;
}
}
lokalBuffer[i]='A';
}

------------------------------------------------------



public int receive(byte[] buffer, int size)
{
I could need a little help here
}
Thank you