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<java.nio.ByteBuffer>
,Encoder
,Encoder.Binary<java.nio.ByteBuffer>
public class NoOpByteBufferCoder extends CoderAdapter implements Decoder.Binary<java.nio.ByteBuffer>, Encoder.Binary<java.nio.ByteBuffer>
- Author:
- Stepan Kopriva (stepan.kopriva at oracle.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.websocket.Decoder
Decoder.Binary<T>, Decoder.BinaryStream<T>, Decoder.Text<T>, Decoder.TextStream<T>
-
Nested classes/interfaces inherited from interface javax.websocket.Encoder
Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>
-
-
Constructor Summary
Constructors Constructor Description NoOpByteBufferCoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
decode(java.nio.ByteBuffer bytes)
Decode the given bytes into an object of type T.java.nio.ByteBuffer
encode(java.nio.ByteBuffer object)
Encode the given object into a byte array.boolean
willDecode(java.nio.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.CoderAdapter
destroy, init
-
-
-
-
Method Detail
-
willDecode
public boolean willDecode(java.nio.ByteBuffer bytes)
Description copied from interface:Decoder.Binary
Answer whether the given bytes can be decoded into an object of type T.- Specified by:
willDecode
in interfaceDecoder.Binary<java.nio.ByteBuffer>
- Parameters:
bytes
- the bytes to be decoded.- Returns:
- whether or not the bytes can be decoded by this decoder.
-
decode
public java.nio.ByteBuffer decode(java.nio.ByteBuffer bytes) throws DecodeException
Description copied from interface:Decoder.Binary
Decode the given bytes into an object of type T.- Specified by:
decode
in interfaceDecoder.Binary<java.nio.ByteBuffer>
- Parameters:
bytes
- the bytes to be decoded.- Returns:
- the decoded object.
- Throws:
DecodeException
- If the provided bytes cannot be decoded to type T
-
encode
public java.nio.ByteBuffer encode(java.nio.ByteBuffer object) throws EncodeException
Description copied from interface:Encoder.Binary
Encode the given object into a byte array.- Specified by:
encode
in interfaceEncoder.Binary<java.nio.ByteBuffer>
- Parameters:
object
- the object being encoded.- Returns:
- the binary data.
- Throws:
EncodeException
- The provided object could not be encoded to a byte buffer
-
-