@Test
    public void testAsciiEncoding() throws Exception {
        String stringValue = "1234567891234567891";
        byte[] bytes = stringValue.getBytes(StandardCharsets.UTF_8);

        // Parse the input
        ReadBufferByteBased readBufferByteBased = new ReadBufferByteBased(bytes);
        BigInteger bigIntegerValue = readBufferByteBased.readUnsignedBigInteger("test", stringValue.length() * 8, WithReaderWriterArgs.WithEncoding("ASCII"));

        // Check the expected value matches
        Assertions.assertEquals(new BigInteger(stringValue), bigIntegerValue);

        // Serialize the value again
        WriteBufferByteBased writeBufferByteBased = new WriteBufferByteBased(stringValue.length());
        writeBufferByteBased.writeUnsignedBigInteger("test", stringValue.length() * 8, bigIntegerValue, WithReaderWriterArgs.WithEncoding("ASCII"));

        // Check the output matches the original one
        byte[] serializedBytes = writeBufferByteBased.getBytes();
        Assertions.assertArrayEquals(bytes, serializedBytes);
    }
In ASCII encoding the number is simply represented as a UTF-8 string.

@throws Exception something went wrong
plc4j/spi/src/test/java/org/apache/plc4x/java/spi/generation/UnsignedBigIntegerTest.java