@Override
    public byte[] serialize(final String topic, final TimestampedKeyAndJoinSide<K> data) {
        final byte boolByte = (byte) (data.isLeftSide() ? 1 : 0);
        final byte[] keyBytes = keySerializer.serialize(topic, data.getKey());
        final byte[] timestampBytes = timestampSerializer.serialize(topic, data.getTimestamp());

        return ByteBuffer
            .allocate(timestampBytes.length + 1 + keyBytes.length)
            .put(timestampBytes)
            .put(boolByte)
            .put(keyBytes)
            .array();
    }
The serializer that is used for {@link TimestampedKeyAndJoinSide}, which is a combo key format of <timestamp, left/right flag, raw-key>
@param <K> the raw key type
streams/src/main/java/org/apache/kafka/streams/state/internals/TimestampedKeyAndJoinSideSerializer.java