Package org.jolokia.server.core.util
Class ChunkedWriter
java.lang.Object
java.io.Writer
org.jolokia.server.core.util.ChunkedWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Created by gnufied on 2/7/16.
Implement chunked writing of data. Part of chunking is actually already
done by OutputStream and doing so here again will result in double chunking.
We just ensure that, we are flushing and closing the stream properly.
This code is very closely yanked from java.nio.StreamEncoder class.
The reason we couldn't simply extend StreamEncoder class is, that class marks certain
attributes private which are very important for overriding close and flush methods.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ChunkedWriter
-
-
Method Details
-
isOpen
public boolean isOpen() -
write
- Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-