Package io.undertow.servlet.core
Class BlockingWriterSenderImpl
java.lang.Object
io.undertow.servlet.core.BlockingWriterSenderImpl
- All Implemented Interfaces:
Sender
A sender that uses a print writer.
In general this should never be used. It exists for the edge case where a filter has called
getWriter() and then the default servlet is being used to serve a text file.
- Author:
- Stuart Douglas
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTODO: we should be used pooled buffers -
Constructor Summary
ConstructorsConstructorDescriptionBlockingWriterSenderImpl(HttpServerExchange exchange, PrintWriter writer, String charset) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this sender asynchronouslyvoidclose(IoCallback callback) Closes this sender asynchronously.voidWrite the given String using async IO, and ends the exchange when donevoidsend(String data, IoCallback callback) Write the given String using async IO, and calls the given callback on completion or error.voidWrite the given String using async IO, and ends the exchange when donevoidsend(String data, Charset charset, IoCallback callback) Write the given String using async IO, and calls the given callback on completion or error.voidsend(ByteBuffer buffer) Write the given buffer using async IO, and ends the exchange when donevoidsend(ByteBuffer[] buffer) Write the given buffers using async IO, and ends the exchange when donevoidsend(ByteBuffer[] buffer, IoCallback callback) Write the given buffers using async IO, and calls the given callback on completion or error.voidsend(ByteBuffer buffer, IoCallback callback) Write the given buffer using async IO, and calls the given callback on completion or error.voidtransferFrom(FileChannel source, IoCallback callback) Transfers all content from the specified file
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZETODO: we should be used pooled buffers- See Also:
-
-
Constructor Details
-
BlockingWriterSenderImpl
-
-
Method Details
-
send
Description copied from interface:SenderWrite the given buffer using async IO, and calls the given callback on completion or error. -
send
Description copied from interface:SenderWrite the given buffers using async IO, and calls the given callback on completion or error. -
send
Description copied from interface:SenderWrite the given String using async IO, and calls the given callback on completion or error.The CharSequence is encoded to UTF8
-
send
Description copied from interface:SenderWrite the given buffer using async IO, and ends the exchange when done -
send
Description copied from interface:SenderWrite the given buffers using async IO, and ends the exchange when done -
send
Description copied from interface:SenderWrite the given String using async IO, and calls the given callback on completion or error. -
send
Description copied from interface:SenderWrite the given String using async IO, and ends the exchange when doneThe CharSequence is encoded to UTF8
-
send
Description copied from interface:SenderWrite the given String using async IO, and ends the exchange when done -
transferFrom
Description copied from interface:SenderTransfers all content from the specified file- Specified by:
transferFromin interfaceSender- Parameters:
source- the file channel to transfercallback- The callback
-
close
Description copied from interface:SenderCloses this sender asynchronously. The given callback is notified on completion -
close
public void close()Description copied from interface:SenderCloses this sender asynchronously
-