Package org.glassfish.tyrus.core.coder
Class NoOpByteBufferCoder
java.lang.Object
org.glassfish.tyrus.core.coder.CoderAdapter
org.glassfish.tyrus.core.coder.NoOpByteBufferCoder
- All Implemented Interfaces:
- Decoder,- Decoder.Binary<ByteBuffer>,- Encoder,- Encoder.Binary<ByteBuffer>
public class NoOpByteBufferCoder
extends CoderAdapter
implements Decoder.Binary<ByteBuffer>, Encoder.Binary<ByteBuffer>
- Author:
- Stepan Kopriva
- 
Nested Class SummaryNested classes/interfaces inherited from interface jakarta.websocket.DecoderDecoder.Binary<T>, Decoder.BinaryStream<T>, Decoder.Text<T>, Decoder.TextStream<T>Nested classes/interfaces inherited from interface jakarta.websocket.EncoderEncoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondecode(ByteBuffer bytes) Decode the given bytes into an object of type T.encode(ByteBuffer object) Encode the given object into a byte array.booleanwillDecode(ByteBuffer bytes) Answer whether the given bytes can be decoded into an object of type T.Methods inherited from class org.glassfish.tyrus.core.coder.CoderAdapterdestroy, init
- 
Constructor Details- 
NoOpByteBufferCoderpublic NoOpByteBufferCoder()
 
- 
- 
Method Details- 
willDecodeDescription copied from interface:Decoder.BinaryAnswer whether the given bytes can be decoded into an object of type T.It is not safe for other threads to use the ByteBuffer until this method completes. When the method completes, the buffer will be in the same state as it was at the start of the method call. - Specified by:
- willDecodein interface- Decoder.Binary<ByteBuffer>
- Parameters:
- bytes- the bytes to be decoded.
- Returns:
- whether or not the bytes can be decoded by this decoder.
 
- 
decodeDescription copied from interface:Decoder.BinaryDecode the given bytes into an object of type T.It is not safe for other threads to use the ByteBuffer until the decoding of the given bytes is complete. If the decoding completes successfully, the buffer's limit will be unchanged and the buffer's position will be equal to the limit. If the decoding does not complete successfully, the state of the buffer is undefined. - Specified by:
- decodein interface- Decoder.Binary<ByteBuffer>
- Parameters:
- bytes- the bytes to be decoded.
- Returns:
- the decoded object.
- Throws:
- DecodeException- If the provided bytes cannot be decoded to type T
 
- 
encodeDescription copied from interface:Encoder.BinaryEncode the given object into a byte array.- Specified by:
- encodein interface- Encoder.Binary<ByteBuffer>
- Parameters:
- object- the object being encoded.
- Returns:
- the binary data.
- Throws:
- EncodeException- The provided object could not be encoded to a byte buffer
 
 
-