java - What is the inverse of OutputStreamWriter -
an outputstreamwriter wraps outputstream behind writer interface. if want inverse, want outputstream interface writer? instance want serialize object stringwriter.
the semantic of outputstreamwriter
take text , transform according character encoding bytes. common pattern (low level bytes interpreted high level text) isn't surprising find class part of standard java api.
so want writeroutputstream
. forgot tell semantics expect such class. can imagine several use cases outputstream
wrapping writer
:
- convert bytes base64 encoded string
- convert bytes table of hex values
- assuming byte stream encrypted text message: decrypt bytes , write original unencrypted text.
- assuming byte stream values of kind of measuring device: write human readable table containing measured values.
but there no obvious default use case makes sense broad usage. there no writeroutputstream
class in standard library. no 1 prevents write such class of own.
Comments
Post a Comment