类 CodecOutputByteArray
java.lang.Object
com.baidu.bjf.remoting.protobuf.code.CodecOutputByteArray
Get byte array from codec and object.
Avoid create a lot of CodedOutputStream object.
Borrow obj from this thread and recycle in this thread too.
It not a real object pool. Just thread scope cache.
- 作者:
- qiunet 2022/8/12 14:23
-
方法概要
修饰符和类型方法说明static voidclear()clear stackstatic CodecOutputByteArrayget()get CodecOutputByteArrayGetter from ThreadLocalcom.google.protobuf.CodedOutputStreamget CodedOutputStream instancebyte[]getData()get byte array datastatic <T> byte[]get byte array from codec and objectstatic intget thread scope size
-
方法详细资料
-
get
get CodecOutputByteArrayGetter from ThreadLocal- 返回:
- CodecOutputByteArrayGetter instance
-
threadScopeSize
public static int threadScopeSize()get thread scope size- 返回:
-
clear
public static void clear()clear stack -
getCodedOutputStream
public com.google.protobuf.CodedOutputStream getCodedOutputStream()get CodedOutputStream instance- 返回:
-
getData
get byte array data- 返回:
- byte array
- 抛出:
IOException
-
getData
get byte array from codec and object- 类型参数:
T-- 参数:
codec- codecobj- obj- 返回:
- byte array
- 抛出:
IOException
-