@Override
        public WriteBufferByteBased serialize(ModbusAsciiADU value) throws SerializationException {
            // First serialize the packet the normal way.
            WriteBufferByteBased writeBufferByteBased = new WriteBufferByteBased(value.getLengthInBytes());
            value.serialize(writeBufferByteBased);
            // Get the bytes.
            final byte[] decodedBytes = writeBufferByteBased.getBytes();
            // Now encode each byte as two hex values.
            final String hexString = Hex.encodeHexString(decodedBytes).toUpperCase();
            // Create a new WriteBuffer with the encoded data.
            WriteBufferByteBased encodedWriteBuffer = new WriteBufferByteBased(hexString.length() + 3);
            // Write the leading ":"
            encodedWriteBuffer.writeShort(8, (short) 0x3a);
            encodedWriteBuffer.writeByteArray(hexString.getBytes(StandardCharsets.UTF_8));
            // Write the ending line-break, carriage return.
            encodedWriteBuffer.writeShort(8, (short) 0x0d);
            encodedWriteBuffer.writeShort(8, (short) 0x0a);
            return encodedWriteBuffer;
        }
Consumes all Bytes until the starting character ":" is found
plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/ascii/ModbusAsciiDriver.java