I have the next java functional interface

```
@FunctionalInterface
public interface FragmentHandler {
     void onFragment(DirectBuffer buffer, int offset, int length, Header header);
}

```

I have a very simple interface implementation

```
public static FragmentHandler printStringMessage(int streamId) {
    return (buffer, offset, length, header) -> {
        byte[] data = new byte[length];
        buffer.getBytes(offset, data);
        System.out.println(String.format("Message to stream %d from session %d (%d@%d) <<%s>>", streamId, header.sessionId(), length, offset, new String(data)));
    };
}

```

I'd like to write the same structure using Kotlin

```
fun printStringMessage(streamId: Int): FragmentHandler {
    val lambda: (DirectBuffer, Int, Int, Header) -> Unit = { buffer: DirectBuffer, length: Int, offset: Int, header: Header ->
        val data = ByteArray(length)
        buffer.getBytes(offset, data)
        println(String.format("Message to stream %d from session %d (%d@%d) <<%s>>", streamId, header.sessionId(), length, offset, String(data)))
    }
}

```

But this code is not valid. I don't undersrand how to implement the same peace of logic in Kotlin.