private static void sendLines(SocketChannel socketChannel, List<String> lines) throws IOException {
    var buffer = ByteBuffer.allocate(BUFFER_LENGTH);
    buffer.putInt(MARKER).putShort((short)0);

    for (var line : lines) {
      var bytes = line.getBytes(StandardCharsets.UTF_8);
      buffer.putShort((short)bytes.length);
      buffer.put(bytes);
    }

    buffer.putShort(4, (short)buffer.position());

    if (LOG.isDebugEnabled()) LOG.debug("sending: " + lines + ", bytes:" + buffer.position());
    buffer.flip();
    while (buffer.hasRemaining()) {
      socketChannel.write(buffer);
    }
  }
private static void sendLines(SocketChannel socketChannel, List<String> lines)