Top Description Constructors Methods
org.glassfish.tyrus.core.coder

public Class InputStreamDecoder

extends CoderAdapter
implements Decoder.Binary<InputStream>
Class Inheritance
All Implemented Interfaces
jakarta.websocket.Decoder.Binary, jakarta.websocket.Decoder
Imports
java.io.ByteArrayInputStream, .InputStream, java.nio.ByteBuffer, jakarta.websocket.DecodeException, .Decoder

Built in Decoder for java.io.InputStream.
Author
Pavel Bucek

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public InputStream
decode(ByteBuffer
the bytes to be decoded.
bytes
)

Implements jakarta.websocket.Decoder.Binary.decode.

Decode the given bytes into an object of type T.

public boolean
willDecode(ByteBuffer
the bytes to be decoded.
bytes
)

Implements jakarta.websocket.Decoder.Binary.willDecode.

Answer whether the given bytes can be decoded into an object of type T.

Inherited from org.glassfish.tyrus.core.coder.CoderAdapter:
destroyinit

Constructor Detail

InputStreamDecoderback to summary
public InputStreamDecoder()

Method Detail

decodeback to summary
public InputStream decode(ByteBuffer bytes) throws DecodeException

Implements jakarta.websocket.Decoder.Binary.decode.

Doc from jakarta.websocket.Decoder.Binary.decode.

Decode 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.

Parameters
bytes:ByteBuffer

the bytes to be decoded.

Returns:InputStream

the decoded object.

Annotations
@Override
Exceptions
DecodeException:
If the provided bytes cannot be decoded to type T
willDecodeback to summary
public boolean willDecode(ByteBuffer bytes)

Implements jakarta.websocket.Decoder.Binary.willDecode.

Doc from jakarta.websocket.Decoder.Binary.willDecode.

Answer 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.

Parameters
bytes:ByteBuffer

the bytes to be decoded.

Returns:boolean

whether or not the bytes can be decoded by this decoder.

Annotations
@Override