# Class PojoMessageHandlerWholeBinary

java.lang.Object
org.apache.tomcat.websocket.pojo.PojoMessageHandlerBase<ByteBuffer>
org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase<ByteBuffer>
org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBinary

All Implemented Interfaces:
  `MessageHandler, MessageHandler.Whole<ByteBuffer>, WrappedMessageHandler`

public class PojoMessageHandlerWholeBinary extends PojoMessageHandlerWholeBase<ByteBuffer>
ByteBuffer specific concrete implementation for handling whole messages.

## Nested Class Summary

### Nested classes/interfaces inherited from interface MessageHandler

`MessageHandler.Partial<T>, MessageHandler.Whole<T>`

## Field Summary

### Fields inherited from class PojoMessageHandlerWholeBase

`decoders`

### Fields inherited from class PojoMessageHandlerBase

`convert, indexPayload, indexSession, maxMessageSize, method, params, pojo, session`

## Constructor Summary

Constructors
Constructor
Description
`PojoMessageHandlerWholeBinary(Object pojo, Method method, Session session, EndpointConfig config, List<Class<? extends Decoder>> decoderClazzes, Object[] params, int indexPayload, boolean convert, int indexSession, boolean isForInputStream, long maxMessageSize)`
Create a whole binary message handler.

## Method Summary

Modifier and Type
Method
Description
`protected Object`
`convert(ByteBuffer message)`
Convert the message to the type expected by the target method.
`protected Object`
`decode(ByteBuffer message)`
Decode the message using the registered decoders.

### Methods inherited from class PojoMessageHandlerWholeBase

`createDecoderInstance, onClose, onMessage`

### Methods inherited from class PojoMessageHandlerBase

`getMaxMessageSize, getWrappedHandler, handlePojoMethodInvocationTargetException, processResult`

### Methods inherited from class Object

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

## Constructor Details

### PojoMessageHandlerWholeBinary

public PojoMessageHandlerWholeBinary(Object pojo, Method method, Session session, EndpointConfig config, List<Class<? extends Decoder>> decoderClazzes, Object[] params, int indexPayload, boolean convert, int indexSession, boolean isForInputStream, long maxMessageSize)
Create a whole binary message handler.

Parameters:
  `pojo` - POJO instance
  `method` - Method to invoke
  `session` - WebSocket session
  `config` - Endpoint configuration
  `decoderClazzes` - List of decoder classes
  `params` - Pre-populated parameter array
  `indexPayload` - Index of the payload parameter
  `convert` - Convert the message before passing to the method
  `indexSession` - Index of the session parameter
  `isForInputStream` - True if the payload is an InputStream
  `maxMessageSize` - Maximum message size

## Method Details

### decode

protected Object decode(ByteBuffer message) throws DecodeException
Description copied from class: `PojoMessageHandlerWholeBase`
Decode the message using the registered decoders.

Specified by:
  `decode` in class `PojoMessageHandlerWholeBase<ByteBuffer>`
Parameters:
  `message` - Message to decode
Returns:
  Decoded message or `null` if no decoder could decode it
Throws:
  `DecodeException` - If the message cannot be decoded

### convert

protected Object convert(ByteBuffer message)
Description copied from class: `PojoMessageHandlerWholeBase`
Convert the message to the type expected by the target method.

Overrides:
  `convert` in class `PojoMessageHandlerWholeBase<ByteBuffer>`
Parameters:
  `message` - Message to convert
Returns:
  Converted message