public static Bytes toBinary(final Bytes key,
                                     final long startTime,
                                     final long endTime) {
            final ByteBuffer buf = ByteBuffer.allocate(PREFIX_SIZE + SessionKeySchema.keyByteLength(key));
            buf.put(KEY_FIRST_PREFIX);
            SessionKeySchema.writeBinary(buf, key, startTime, endTime);
            return Bytes.wrap(buf.array());
        }
@param key the key in the range
@param from the earliest end timestamp in the range
streams/src/main/java/org/apache/kafka/streams/state/internals/PrefixedSessionKeySchemas.java