io.undertow.io

## Class AsyncSenderImpl

- java.lang.Object
- - io.undertow.io.AsyncSenderImpl

All Implemented Interfaces:
  Sender

    public class AsyncSenderImpl
    extends Object
    implements Sender

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`class` `AsyncSenderImpl.TransferTask`

### Constructor Summary

Constructors
Constructor and Description
`AsyncSenderImpl(HttpServerExchange exchange)`

### Method Summary

All Methods Instance Methods Concrete Methods
`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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AsyncSenderImpl

    public AsyncSenderImpl(HttpServerExchange exchange)

### Method Detail

#### send

    public void send(ByteBuffer buffer,
                     IoCallback callback)

Description copied from interface: `Sender`
Write the given buffer using async IO, and calls the given callback on completion or error.

Specified by:
  `send` in interface `Sender`
Parameters:
  `buffer` - The buffer to send.
  `callback` - The callback

#### send

    public void send(ByteBuffer[] buffer,
                     IoCallback callback)

Description copied from interface: `Sender`
Write the given buffers using async IO, and calls the given callback on completion or error.

Specified by:
  `send` in interface `Sender`
Parameters:
  `buffer` - The buffers to send.
  `callback` - The callback

#### transferFrom

    public void transferFrom(FileChannel source,
                             IoCallback callback)

Description copied from interface: `Sender`
Transfers all content from the specified file

Specified by:
  `transferFrom` in interface `Sender`
Parameters:
  `source` - the file channel to transfer
  `callback` - The callback

#### send

    public void send(ByteBuffer buffer)

Description copied from interface: `Sender`
Write the given buffer using async IO, and ends the exchange when done

Specified by:
  `send` in interface `Sender`
Parameters:
  `buffer` - The buffer to send.

#### send

    public void send(ByteBuffer[] buffer)

Description copied from interface: `Sender`
Write the given buffers using async IO, and ends the exchange when done

Specified by:
  `send` in interface `Sender`
Parameters:
  `buffer` - The buffers to send.

#### send

    public void send(String data,
                     IoCallback callback)

Description copied from interface: `Sender`
Write the given String using async IO, and calls the given callback on completion or error.

The CharSequence is encoded to UTF8

Specified by:
  `send` in interface `Sender`
Parameters:
  `data` - The data to send
  `callback` - The callback

#### send

    public void send(String data,
                     Charset charset,
                     IoCallback callback)

Description copied from interface: `Sender`
Write the given String using async IO, and calls the given callback on completion or error.

Specified by:
  `send` in interface `Sender`
Parameters:
  `data` - The buffer to end.
  `charset` - The charset to use
  `callback` - The callback

#### send

    public void send(String data)

Description copied from interface: `Sender`
Write the given String using async IO, and ends the exchange when done

The CharSequence is encoded to UTF8

Specified by:
  `send` in interface `Sender`
Parameters:
  `data` - The data to send

#### send

    public void send(String data,
                     Charset charset)

Description copied from interface: `Sender`
Write the given String using async IO, and ends the exchange when done

Specified by:
  `send` in interface `Sender`
Parameters:
  `data` - The buffer to end.
  `charset` - The charset to use

#### close

    public void close(IoCallback callback)

Description copied from interface: `Sender`
Closes this sender asynchronously. The given callback is notified on completion

Specified by:
  `close` in interface `Sender`
Parameters:
  `callback` - The callback that is notified when all data has been flushed and the channel is closed

#### close

    public void close()

Description copied from interface: `Sender`
Closes this sender asynchronously

Specified by:
  `close` in interface `Sender`