Class BufferedWriter
- java.lang.Object
-
- java.io.Writer
-
- org.opendaylight.netconf.nettyutil.handler.BufferedWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public final class BufferedWriter extends Writer
Custom BufferedWriter optimized for netconf pipeline implemented instead of default BufferedWriter provided by jdk.The line separator instance field in java.io.BufferedWriter is assigned using AccessController and takes considerable amount of time especially if lots of BufferedWriters are created in the system.
This implementation should only be used if newLine method is not required such as netconf message to XML encoders. Methods in this implementation are not synchronized.
-
-
Constructor Summary
Constructors Constructor Description BufferedWriter(Writer writer)BufferedWriter(Writer writer, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(char[] buffer, int offset, int length)voidwrite(int character)voidwrite(String string, int offset, int length)
-
-
-
Method Detail
-
write
public void write(int character) throws IOException- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(char[] buffer, int offset, int length) throws IOException- Specified by:
writein classWriter- Throws:
IOException
-
write
public void write(String string, int offset, int length) throws IOException
- Overrides:
writein classWriter- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
-