testRoundTrip

fun <T> Codec<T>.testRoundTrip(value: T, expectedBytes: ByteArray? = null, factory: BufferFactory = BufferFactory.Default): T

Testing utility: encodes value, optionally verifies the wire bytes match expectedBytes, then decodes and returns the result. Intended for use in test suites to validate codec correctness.