throw WebSocketMessages.MESSAGES.lengthBiggerThenFileChannel();
}
StreamSinkChannel sink = StreamSinkChannelUtils.applyAsyncSendTimeout(session, createSink(length));
long written = 0;
while (written < length) {
long w = sink.transferFrom(payloadChannel, offset + written, length - written);
if (w == 0) {
final long writtenBytes = written;
sink.getWriteSetter().set(new ChannelListener<StreamSinkChannel>() {
long written = writtenBytes;
@Override