Top Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common.encoders

public Class ByteArrayEncoder

extends Object
implements Encoder.Binary<byte[]>
Class Inheritance
All Implemented Interfaces
jakarta.websocket.Encoder.Binary, jakarta.websocket.Encoder
Imports
java.nio.ByteBuffer, jakarta.websocket.EncodeException, .Encoder, .EndpointConfig

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Overrides default jakarta.websocket.Encoder.destroy.

This method is called when the encoder is about to be removed from service in order that any resources the encoder used may be closed gracefully.

public ByteBuffer
encode(byte[]
the object being encoded.
object
)

Implements jakarta.websocket.Encoder.Binary.encode.

Encode the given object into a byte array.

public void
init(EndpointConfig
the endpoint configuration object when being brought into service
config
)

Overrides default jakarta.websocket.Encoder.init.

This method is called with the endpoint configuration object of the endpoint this encoder is intended for when it is about to be brought into service.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ByteArrayEncoderback to summary
public ByteArrayEncoder()

Method Detail

destroyback to summary
public void destroy()

Overrides default jakarta.websocket.Encoder.destroy.

Doc from jakarta.websocket.Encoder.destroy.

This method is called when the encoder is about to be removed from service in order that any resources the encoder used may be closed gracefully.

Annotations
@Override
encodeback to summary
public ByteBuffer encode(byte[] object) throws EncodeException

Implements jakarta.websocket.Encoder.Binary.encode.

Doc from jakarta.websocket.Encoder.Binary.encode.

Encode the given object into a byte array.

Parameters
object:byte[]

the object being encoded.

Returns:ByteBuffer

the binary data.

Annotations
@Override
Exceptions
EncodeException:
The provided object could not be encoded to a byte buffer
initback to summary
public void init(EndpointConfig config)

Overrides default jakarta.websocket.Encoder.init.

Doc from jakarta.websocket.Encoder.init.

This method is called with the endpoint configuration object of the endpoint this encoder is intended for when it is about to be brought into service.

Parameters
config:EndpointConfig

the endpoint configuration object when being brought into service

Annotations
@Override