@Override
        public int write(ByteBuf buf) {
            int expectedToWrite = buf.readableBytes();
            byte[] bytes = new byte[expectedToWrite];
            buf.readBytes(bytes);
            int bytesWritten = comPort.writeBytes(bytes, expectedToWrite);
            return bytesWritten;
        }
@return Number of bytes written to wire
plc4j/transports/serial/src/main/java/org/apache/plc4x/java/transport/serial/SerialChannelHandler.java