Skip to content

Commit e92c60c

Browse files
author
Sylvain Brocard
committed
Add support for RFC 5425
Remove unused import and simplify code
1 parent 8296e34 commit e92c60c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/com/cloudbees/syslog/SyslogMessage.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import javax.annotation.Nonnull;
1919
import javax.annotation.Nullable;
2020

21-
import java.io.ByteArrayOutputStream;
2221
import java.io.CharArrayWriter;
2322
import java.io.IOException;
2423
import java.io.StringWriter;
@@ -301,9 +300,7 @@ public String toRfc5425SyslogMessage() {
301300
*/
302301
public void toRfc5425SyslogMessage(Writer out) throws IOException {
303302

304-
StringWriter sw = new StringWriter(msg == null ? 32 : msg.size() + 32);
305-
toRfc5424SyslogMessage(sw);
306-
String rfc5424Message = sw.toString();
303+
String rfc5424Message = toRfc5424SyslogMessage();
307304
int length = rfc5424Message.getBytes(StandardCharsets.UTF_8).length;
308305
out.write(String.valueOf(length));
309306
out.write(SP);

0 commit comments

Comments
 (0)