io.undertow.io

## Class AsyncReceiverImpl

- java.lang.Object
- - io.undertow.io.AsyncReceiverImpl

All Implemented Interfaces:
  Receiver

    public class AsyncReceiverImpl
    extends Object
    implements Receiver

Author:
  Stuart Douglas

### Nested Class Summary

### Nested classes/interfaces inherited from interface io.undertow.io.Receiver

`Receiver.ErrorCallback, Receiver.FullBytesCallback, Receiver.FullStringCallback, Receiver.PartialBytesCallback, Receiver.PartialStringCallback, Receiver.RequestToLargeException`

### Field Summary

Fields
`static byte[]` `EMPTY_BYTE_ARRAY`

### Constructor Summary

Constructors
Constructor and Description
`AsyncReceiverImpl(HttpServerExchange exchange)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `pause()` When receiving partial data calling this method will pause the callbacks.
`void` `receiveFullBytes(Receiver.FullBytesCallback callback)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receiveFullBytes(Receiver.FullBytesCallback callback, Receiver.ErrorCallback errorCallback)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receiveFullString(Receiver.FullStringCallback callback)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receiveFullString(Receiver.FullStringCallback callback, Charset charset)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receiveFullString(Receiver.FullStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset)` Reads the request and invokes the callback when the request body has been fully read.
`void` `receivePartialBytes(Receiver.PartialBytesCallback callback)` Reads the request and invokes the callback with request data.
`void` `receivePartialBytes(Receiver.PartialBytesCallback callback, Receiver.ErrorCallback errorCallback)` Reads the request and invokes the callback with request data.
`void` `receivePartialString(Receiver.PartialStringCallback callback)` Reads the request and invokes the callback with request data.
`void` `receivePartialString(Receiver.PartialStringCallback callback, Charset charset)` Reads the request and invokes the callback with request data.
`void` `receivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback)` Reads the request and invokes the callback with request data.
`void` `receivePartialString(Receiver.PartialStringCallback callback, Receiver.ErrorCallback errorCallback, Charset charset)` Reads the request and invokes the callback with request data.
`void` `resume()` Resumes paused callbacks.
`void` `setMaxBufferSize(int maxBufferSize)` Sets the maximum amount of data that will be buffered in memory.

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

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

### Field Detail

#### EMPTY_BYTE_ARRAY

    public static final byte[] EMPTY_BYTE_ARRAY

### Constructor Detail

#### AsyncReceiverImpl

    public AsyncReceiverImpl(HttpServerExchange exchange)

### Method Detail

#### setMaxBufferSize

    public void setMaxBufferSize(int maxBufferSize)

Description copied from interface: `Receiver`
Sets the maximum amount of data that will be buffered in memory. If you call a receiveFull* method and the request size is larger than this amount then the error callback with be invoked with a `RequestTooBigException`.

Specified by:
  `setMaxBufferSize` in interface `Receiver`
Parameters:
  `maxBufferSize` - The maximum amount of data to be buffered

#### receiveFullString

    public void receiveFullString(Receiver.FullStringCallback callback,
                                  Receiver.ErrorCallback errorCallback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to `StandardCharsets.ISO_8859_1`. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receiveFullString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error

#### receiveFullString

    public void receiveFullString(Receiver.FullStringCallback callback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to `StandardCharsets.ISO_8859_1`. If there is an error the exchange will be ended.

Specified by:
  `receiveFullString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request

#### receivePartialString

    public void receivePartialString(Receiver.PartialStringCallback callback,
                                     Receiver.ErrorCallback errorCallback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to `StandardCharsets.ISO_8859_1`. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receivePartialString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error

#### receivePartialString

    public void receivePartialString(Receiver.PartialStringCallback callback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to `StandardCharsets.ISO_8859_1`. If there is an error the exchange will be ended.

Specified by:
  `receivePartialString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request

#### receiveFullString

    public void receiveFullString(Receiver.FullStringCallback callback,
                                  Receiver.ErrorCallback errorCallback,
                                  Charset charset)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receiveFullString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error
  `charset` - The charset that is used to interpret the string

#### receiveFullString

    public void receiveFullString(Receiver.FullStringCallback callback,
                                  Charset charset)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.

Specified by:
  `receiveFullString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `charset` - The charset that is used to interpret the string

#### receivePartialString

    public void receivePartialString(Receiver.PartialStringCallback callback,
                                     Receiver.ErrorCallback errorCallback,
                                     Charset charset)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receivePartialString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error
  `charset` - The charset that is used to interpret the string

#### receivePartialString

    public void receivePartialString(Receiver.PartialStringCallback callback,
                                     Charset charset)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. This string will be interpreted according to the specified charset. If there is an error the exchange will be ended.

Specified by:
  `receivePartialString` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `charset` - The charset that is used to interpret the string

#### receiveFullBytes

    public void receiveFullBytes(Receiver.FullBytesCallback callback,
                                 Receiver.ErrorCallback errorCallback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receiveFullBytes` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error

#### receiveFullBytes

    public void receiveFullBytes(Receiver.FullBytesCallback callback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback when the request body has been fully read. If there is an error the exchange will be ended.

Specified by:
  `receiveFullBytes` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request

#### receivePartialBytes

    public void receivePartialBytes(Receiver.PartialBytesCallback callback,
                                    Receiver.ErrorCallback errorCallback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error reading the request the error callback will be invoked.

Specified by:
  `receivePartialBytes` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request
  `errorCallback` - The callback that is invoked on error

#### receivePartialBytes

    public void receivePartialBytes(Receiver.PartialBytesCallback callback)

Description copied from interface: `Receiver`
Reads the request and invokes the callback with request data. The callback may be invoked multiple times, and on the last time the last parameter will be true. If there is an error the exchange will be ended.

Specified by:
  `receivePartialBytes` in interface `Receiver`
Parameters:
  `callback` - The callback to invoke with the request

#### pause

    public void pause()

Description copied from interface: `Receiver`
When receiving partial data calling this method will pause the callbacks. Callbacks will not resume until `Receiver.resume()` has been called.

Specified by:
  `pause` in interface `Receiver`

#### resume

    public void resume()

Description copied from interface: `Receiver`
Resumes paused callbacks.

Specified by:
  `resume` in interface `Receiver`