public class FrameEncoder extends Object implements IEncoder<Frame,ByteBuffer>
Constructor and Description |
---|
FrameEncoder(boolean clientMode)
Constructs a Web Socket encoder.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(ISession session,
Frame frame,
List<ByteBuffer> out)
Encodes data from one type to another one.
|
Class<Frame> |
getInboundType()
Returns the type of the accepted inbound objects.
|
Class<ByteBuffer> |
getOutboundType()
Returns the type of the produced outbound objects.
|
protected int |
length(Frame frame) |
public FrameEncoder(boolean clientMode)
clientMode
- determines the mode (client/server) in which the encoder
should workpublic Class<Frame> getInboundType()
ICodec
getInboundType
in interface ICodec<Frame,ByteBuffer>
public Class<ByteBuffer> getOutboundType()
ICodec
getOutboundType
in interface ICodec<Frame,ByteBuffer>
public void encode(ISession session, Frame frame, List<ByteBuffer> out) throws Exception
IEncoder
Encoders that do not produce an output (i.e. the O parameter is
Void
) cannot change the object passed as the data
argument. They should not also store it for future use as its state can
be changed.
The above limitations regarding the data
argument do not apply to
encoders that produce an output.
protected int length(Frame frame)
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.