private void WriteFramePacket(byte[] data, int startBit, int endBit) { var lengthBits = endBit - startBit; var frame = BitHelper.CopyBlock(data, startBit, lengthBits); if (lengthBits % 8 != 0) { frame[^ 1] |= (byte)(0xFF >> (lengthBits % 8 + 1)); // padding