public abstract class AbstractPBWireByteMarkerHelper extends Object implements IPBWireByteMarkerHelper
| Constructor and Description |
|---|
AbstractPBWireByteMarkerHelper() |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
bytesToInteger(byte[] marker)
Convert the marker byte array to an integer
|
byte[] |
createMessageDelimiter(com.google.protobuf.GeneratedMessage message)
Create a delimiter for the given GeneratedMessage.
|
int |
estimateTotalContentLength(List<? extends com.google.protobuf.GeneratedMessage> messages)
Estimate the total number of bytes that will be used in a stream for a list
of messages - this includes delimeters.
|
int |
getByteMarkerSize()
Get the number of bytes holding a message size, where these bytes are within
the delimiter byte array and follow the byte marker.
|
int |
getDelimiterSize()
Get the total number of bytes of a delimeter for a generated message.
|
byte |
getMarkerForStart()
Get the byte marker used to identify the start of the delimiter.
|
abstract byte[] |
integerToBytesBigEndian(int value)
Convert the integer into a signed byte array composed of byte shifted parts of the integer.
|
public abstract int bytesToInteger(byte[] marker)
bytesToInteger in interface IPBWireByteMarkerHelpermarker - big endian byte arraypublic abstract byte[] integerToBytesBigEndian(int value)
integerToBytesBigEndian in interface IPBWireByteMarkerHelpervalue - the integer to be represented by the returned byte arraypublic byte[] createMessageDelimiter(com.google.protobuf.GeneratedMessage message)
createMessageDelimiter in interface IPBWireByteMarkerHelpermessage - instance of GeneratedMessagepublic int estimateTotalContentLength(List<? extends com.google.protobuf.GeneratedMessage> messages)
estimateTotalContentLength in interface IPBWireByteMarkerHelpermessages - instances of GeneratedMessagepublic int getByteMarkerSize()
getByteMarkerSize in interface IPBWireByteMarkerHelperpublic int getDelimiterSize()
getDelimiterSize in interface IPBWireByteMarkerHelperpublic byte getMarkerForStart()
getMarkerForStart in interface IPBWireByteMarkerHelperCopyright © 2017. All rights reserved.