public class BlockingWriterSenderImpl extends Object implements Sender
Modifier and Type | Field and Description |
---|---|
static int |
BUFFER_SIZE
TODO: we should be used pooled buffers
|
Constructor and Description |
---|
BlockingWriterSenderImpl(HttpServerExchange exchange,
PrintWriter writer,
String charset) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this sender asynchronously
|
void |
close(IoCallback callback)
Closes this sender asynchronously.
|
void |
send(ByteBuffer buffer)
Write the given buffer using async IO, and ends the exchange when done
|
void |
send(ByteBuffer[] buffer)
Write the given buffers using async IO, and ends the exchange when done
|
void |
send(ByteBuffer[] buffer,
IoCallback callback)
Write the given buffers using async IO, and calls the given callback on completion or error.
|
void |
send(ByteBuffer buffer,
IoCallback callback)
Write the given buffer using async IO, and calls the given callback on completion or error.
|
void |
send(String data)
Write the given String using async IO, and ends the exchange when done
|
void |
send(String data,
Charset charset)
Write the given String using async IO, and ends the exchange when done
|
void |
send(String data,
Charset charset,
IoCallback callback)
Write the given String using async IO, and calls the given callback on completion or error.
|
void |
send(String data,
IoCallback callback)
Write the given String using async IO, and calls the given callback on completion or error.
|
void |
transferFrom(FileChannel source,
IoCallback callback)
Transfers all content from the specified file
|
public static final int BUFFER_SIZE
public BlockingWriterSenderImpl(HttpServerExchange exchange, PrintWriter writer, String charset)
public void send(ByteBuffer buffer, IoCallback callback)
Sender
public void send(ByteBuffer[] buffer, IoCallback callback)
Sender
public void send(String data, IoCallback callback)
Sender
The CharSequence is encoded to UTF8
public void send(ByteBuffer buffer)
Sender
public void send(ByteBuffer[] buffer)
Sender
public void send(String data, Charset charset, IoCallback callback)
Sender
public void send(String data)
Sender
The CharSequence is encoded to UTF8
public void send(String data, Charset charset)
Sender
public void transferFrom(FileChannel source, IoCallback callback)
Sender
transferFrom
in interface Sender
source
- the file channel to transfercallback
- The callbackpublic void close(IoCallback callback)
Sender
Copyright © 2016 JBoss by Red Hat. All rights reserved.