private void byteOut()
{
if (nrOfWrittenBytes >= 0)
{
if (b == 0xFF)
{
// Delay 0xFF byte
delFF = true;
b = SupportClass.URShift(c, 20);
c &= 0xFFFFF;
cT = 7;
}
else if (c < 0x8000000)
{
// Write delayed 0xFF bytes
if (delFF)
{
out_Renamed.write(0xFF);
delFF = false;
nrOfWrittenBytes++;
}
out_Renamed.write(b);
nrOfWrittenBytes++;
b = SupportClass.URShift(c, 19);
c &= 0x7FFFF;
cT = 8;
}
else
{
b++;
if (b == 0xFF)
{
// Delay 0xFF byte
delFF = true;
c &= 0x7FFFFFF;
b = SupportClass.URShift(c, 20);
c &= 0xFFFFF;
cT = 7;
}
else
{
// Write delayed 0xFF bytes
if (delFF)
{
out_Renamed.write(0xFF);
delFF = false;
nrOfWrittenBytes++;
}
out_Renamed.write(b);
nrOfWrittenBytes++;
b = ((SupportClass.URShift(c, 19)) & 0xFF);
c &= 0x7FFFF;
cT = 8;
}
}
}
else
{
// NOTE: carry bit can never be set if the byte buffer was empty
b = (SupportClass.URShift(c, 19));
c &= 0x7FFFF;
cT = 8;
nrOfWrittenBytes++;
}
}