public class BodyWriterImpl extends Object implements Body.Writer
Body.Writer.Bytes, Body.Writer.Text
Constructor and Description |
---|
BodyWriterImpl(Charset charset,
ExSupplier<OutputStream> stream,
ExSupplier<Writer> writer) |
BodyWriterImpl(Charset charset,
Map<String,Object> locals,
ExSupplier<OutputStream> stream,
ExSupplier<Writer> writer) |
Modifier and Type | Method and Description |
---|---|
void |
bytes(Body.Writer.Bytes bin)
Write bytes into the HTTP response body and close the resources.
|
Charset |
charset() |
Map<String,Object> |
locals()
Access to request locals.
|
void |
text(Body.Writer.Text text)
Write text into the HTTP response body using the
Body.Writer.charset() and close the resources. |
public BodyWriterImpl(Charset charset, Map<String,Object> locals, ExSupplier<OutputStream> stream, ExSupplier<Writer> writer)
public BodyWriterImpl(Charset charset, ExSupplier<OutputStream> stream, ExSupplier<Writer> writer)
public Map<String,Object> locals()
Body.Writer
Locals.attributes()
and Locals
.locals
in interface Body.Writer
public Charset charset()
charset
in interface Body.Writer
public void text(Body.Writer.Text text) throws Exception
Body.Writer
Body.Writer.charset()
and close the resources.
It applies the application/request charset.text
in interface Body.Writer
text
- A text strategy.Exception
- When the operation fails.public void bytes(Body.Writer.Bytes bin) throws Exception
Body.Writer
bytes
in interface Body.Writer
bin
- A bytes strategy.Exception
- When the operation fails.Copyright © 2015. All rights reserved.