Class ByteValueList
java.lang.Object
com.iohao.net.framework.protocol.wrapper.ByteValueList
Protocol wrapper for a list of byte array values.
Wraps a List of byte[] for protobuf serialization. Each element in the list
is an individually encoded object, enabling transport of heterogeneous or complex object lists
over the wire. An empty singleton is cached for the no-data case.
- Author:
- 渔民小镇
- date:
- 2023-04-17
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ByteValueListof(Collection<T> values) Encode each element in the collection using the default codec and wrap the results.static <T> ByteValueListof(Collection<T> values, DataCodec codec) Encode each element in the collection using the specified codec and wrap the results.toString()
-
Field Details
-
values
the wrapped list of encoded byte arrays
-
-
Constructor Details
-
ByteValueList
public ByteValueList()
-
-
Method Details
-
of
Encode each element in the collection using the default codec and wrap the results.- Type Parameters:
T- the element type- Parameters:
values- the collection of objects to encode- Returns:
- a ByteValueList containing the encoded byte arrays
-
of
Encode each element in the collection using the specified codec and wrap the results.- Type Parameters:
T- the element type- Parameters:
values- the collection of objects to encodecodec- the codec to use for encoding each element- Returns:
- a ByteValueList containing the encoded byte arrays, or a cached empty instance
-
toString
-