@Override public void accept(SyslogMessage msg) { try { byte[] bytes = msg.toString().getBytes(); int len = bytes.length; for (int i = 0; i < len; i += Buffer.SMALL_BUFFER_SIZE) { int size = Math.min(len - i, Buffer.SMALL_BUFFER_SIZE); out.write(bytes, i, size); } } catch (IOException e) { throw new IllegalStateException(e); } }