docs: private static void decodeEdifactSegment(BitSource bits, StringBuilder result) {
      do {
        // If there is only two or less bytes left then it will be encoded as ASCII
        if (bits.available() <= 16) {
          return;
        }
  
        for (int i = 0; i < 4; i++) {
          int edifactValue = bits.readBits(6);
  
          // Check for the unlatch character
          if (edifactValue == 0x1F) {  // 011111
            // Read rest of byte, which should be 0, and stop
            int bitsLeft = 8 - bits.getBitOffset();
            if (bitsLeft != 8) {
              bits.readBits(bitsLeft);
            }
            return;
          }
  
          if ((edifactValue & 0x20) == 0) {  // no 1 in the leading (6th) bit
            edifactValue |= 0x40;  // Add a leading 01 to the 6 bit binary value
          }
          result.append((char) edifactValue);
        }
      } while (bits.available() > 0);
    }