@Converter
    public static String toString(Record dataRecord) {
        Charset charset = StandardCharsets.UTF_8;

        ByteBuffer buffer = dataRecord.data().asByteBuffer();
        if (buffer.hasArray()) {
            byte[] bytes = dataRecord.data().asByteArray();
            return new String(bytes, charset);
        } else {
            byte[] bytes = new byte[buffer.remaining()];
            buffer.get(bytes);
            return new String(bytes, charset);
        }
    }
@Test
    public void convertRecordToString() {
        Record record = Record.builder().sequenceNumber("1")
                .data(SdkBytes.fromByteBuffer(ByteBuffer.wrap("this is a String".getBytes(StandardCharsets.UTF_8)))).build();

        String result = RecordStringConverter.toString(record);
        assertThat(result, is("this is a String"));
    }