Package io.varhttp
Class VarResponseStream
java.lang.Object
io.varhttp.VarResponseStream
- All Implemented Interfaces:
- ResponseStream
- 
Constructor SummaryConstructorsConstructorDescriptionVarResponseStream(ControllerContext controllerContext, Serializer serializer) 
- 
Method SummaryModifier and TypeMethodDescriptiongetContentWriter(String fileName, String contentType, Charset charset) Get writer that writes to response body in streaming way.getOutputStream(String contentType, Charset charset) Get the output-stream of the response.voidvoidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.varhttp.ResponseStreamgetOutputStream
- 
Constructor Details- 
VarResponseStream
 
- 
- 
Method Details- 
getContentWriterDescription copied from interface:ResponseStreamGet writer that writes to response body in streaming way. This should trigger file download in browser.- Specified by:
- getContentWriterin interface- ResponseStream
- Parameters:
- fileName- Name of file for download eg. name.csv
- contentType- File format eg. text/csv for csv files
- charset- Character encoding of the file content eg. StandardCharsets.UTF-8 for UTF-8 encoding
- Returns:
- writer that writes to response body
 
- 
getOutputStreamDescription copied from interface:ResponseStreamGet the output-stream of the response. Used to write non-string content.- Specified by:
- getOutputStreamin interface- ResponseStream
- Parameters:
- contentType- Content format eg. image/png for PNG files
- charset- Character encoding of the file content eg. StandardCharsets.UTF-8 for UTF-8 encoding
- Returns:
- the output stream of the response.
 
- 
write- Specified by:
- writein interface- ResponseStream
 
- 
write- Specified by:
- writein interface- ResponseStream
 
 
-