Class SerializerPipe
- All Implemented Interfaces:
- Closeable,- AutoCloseable
For character-based serializers, the output object can be any of the following:
- Writer
- OutputStream- Output will be written as UTF-8 encoded stream.
- File- Output will be written as system-default encoded stream.
- StringBuilder
For stream-based serializers, the output object can be any of the following:
See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes the output pipe.Wraps the specified output object inside an output stream.Returns the raw output object passed into this session.Wraps the specified output object inside a writer.voidsetOutputStream(OutputStream outputStream) Overwrites the output stream in this pipe.voidOverwrites the writer in this pipe.
- 
Method Details- 
getOutputStreamWraps the specified output object inside an output stream.Subclasses can override this method to implement their own specialized output streams. This method can be used if the output object is any of the following class types: - Returns:
- The output object wrapped in an output stream.
   Calling OutputStream.close()on the returned object simply flushes the response and does not close the underlying stream.
- Throws:
- IOException- If object could not be converted to an output stream.
 
- 
getWriterWraps the specified output object inside a writer.Subclasses can override this method to implement their own specialized writers. This method can be used if the output object is any of the following class types: - Writer
- OutputStream- Output will be written as UTF-8 encoded stream.
- File- Output will be written as system-default encoded stream.
 - Returns:
- The output object wrapped in a writer.
   Calling Writer.close()on the returned object simply flushes the response and does not close the underlying writer.
- Throws:
- SerializeException- If object could not be converted to a writer.
 
- 
setWriterOverwrites the writer in this pipe.Used when wrapping the writer returned by getWriter()so that the wrapped writer will be flushed and closed whenclose()is called.- Parameters:
- writer- The wrapped writer.
 
- 
setOutputStreamOverwrites the output stream in this pipe.Used when wrapping the stream returned by getOutputStream()so that the wrapped stream will be flushed whenclose()is called.- Parameters:
- outputStream- The wrapped stream.
 
- 
getRawOutputReturns the raw output object passed into this session.- Returns:
- The raw output object passed into this session.
 
- 
closeCloses the output pipe.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
 
-