Package xyz.cofe.trambda.tcp
Class TcpHeader
- java.lang.Object
-
- xyz.cofe.trambda.tcp.TcpHeader
-
public class TcpHeader extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static HeaderValue.IntValuereferrerstatic HeaderValue.IntValuesid
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]encode(String method, byte[] payload)static byte[]encode(String method, byte[] payload, HeaderValue<? extends Object>... values)intgetHeaderSize()StringgetMethodName()Optional<byte[]>getPayloadMd5()intgetPayloadSize()Optional<Integer>getReferrer()Optional<Integer>getSid()Map<String,String>getValues()booleanmatched(byte[] buff, int off, int len)static Optional<TcpHeader>parse(byte[] buff, int off, int len)
-
-
-
Field Detail
-
sid
public static final HeaderValue.IntValue sid
-
referrer
public static final HeaderValue.IntValue referrer
-
-
Method Detail
-
getHeaderSize
public int getHeaderSize()
-
getMethodName
public String getMethodName()
-
getPayloadSize
public int getPayloadSize()
-
getPayloadMd5
public Optional<byte[]> getPayloadMd5()
-
matched
public boolean matched(byte[] buff, int off, int len)
-
encode
public static byte[] encode(String method, byte[] payload)
-
encode
@SafeVarargs public static byte[] encode(String method, byte[] payload, HeaderValue<? extends Object>... values)
-
-