Class BaseMessage<T>
java.lang.Object
org.fusesource.hawtbuf.proto.BaseMessage<T>
- All Implemented Interfaces:
Message<T>
- Direct Known Subclasses:
DeferredDecodeMessage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> voidaddAll(Iterable<T> values, Collection<? super T> list) protected Tvoidclear()abstract Tclone()protected static intcomputeGroupSize(int tag, BaseMessage message) protected static intcomputeMessageSize(int tag, BaseMessage message) private TgetThis()booleanprotected voidload()protected voidmergeFramed(byte[] data) mergeFramed(InputStream input) mergeFramed(Buffer data) mergeFramed(CodedInputStream input) mergeUnframed(byte[] data) mergeUnframed(InputStream input) mergeUnframed(Buffer data) protected static <T extends BaseMessage>
TreadGroup(CodedInputStream input, int tag, T group) protected static bytestatic intRead a raw Varint from the stream.intbyte[]byte[]voidwriteFramed(OutputStream output) voidwriteFramed(CodedOutputStream output) protected static voidwriteGroup(CodedOutputStream output, int tag, BaseMessage message) protected static voidwriteMessage(CodedOutputStream output, int tag, BaseMessage message) voidwriteUnframed(OutputStream output) voidwriteUnframed(CodedOutputStream output) Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Message
mergeUnframed, serializedSizeUnframed
-
Field Details
-
memoizedSerializedSize
protected int memoizedSerializedSize
-
-
Constructor Details
-
BaseMessage
public BaseMessage()
-
-
Method Details
-
clone
-
clear
-
isInitialized
public boolean isInitialized() -
assertInitialized
- Specified by:
assertInitializedin interfaceMessage<T>- Throws:
UninitializedMessageException
-
checktInitialized
- Throws:
InvalidProtocolBufferException
-
missingFields
-
loadAndClear
protected void loadAndClear() -
load
protected void load() -
mergeFrom
-
writeUnframed
- Specified by:
writeUnframedin interfaceMessage<T>- Throws:
IOException
-
writeFramed
- Specified by:
writeFramedin interfaceMessage<T>- Throws:
IOException
-
toUnframedBuffer
- Specified by:
toUnframedBufferin interfaceMessage<T>
-
toFramedBuffer
- Specified by:
toFramedBufferin interfaceMessage<T>
-
toUnframedByteArray
public byte[] toUnframedByteArray()- Specified by:
toUnframedByteArrayin interfaceMessage<T>
-
toFramedByteArray
public byte[] toFramedByteArray()- Specified by:
toFramedByteArrayin interfaceMessage<T>
-
writeFramed
- Specified by:
writeFramedin interfaceMessage<T>- Throws:
IOException
-
writeUnframed
- Specified by:
writeUnframedin interfaceMessage<T>- Throws:
IOException
-
serializedSizeFramed
public int serializedSizeFramed()- Specified by:
serializedSizeFramedin interfaceMessage<T>
-
mergeFramed
- Specified by:
mergeFramedin interfaceMessage<T>- Throws:
IOException
-
mergeUnframed
- Specified by:
mergeUnframedin interfaceMessage<T>- Throws:
InvalidProtocolBufferException
-
getThis
-
mergeFramed
- Specified by:
mergeFramedin interfaceMessage<T>- Throws:
InvalidProtocolBufferException
-
mergeUnframed
- Specified by:
mergeUnframedin interfaceMessage<T>- Throws:
InvalidProtocolBufferException
-
mergeFramed
- Specified by:
mergeFramedin interfaceMessage<T>- Throws:
InvalidProtocolBufferException
-
mergeUnframed
- Specified by:
mergeUnframedin interfaceMessage<T>- Throws:
IOException
-
mergeFramed
- Specified by:
mergeFramedin interfaceMessage<T>- Throws:
IOException
-
addAll
-
writeGroup
protected static void writeGroup(CodedOutputStream output, int tag, BaseMessage message) throws IOException - Throws:
IOException
-
readGroup
protected static <T extends BaseMessage> T readGroup(CodedInputStream input, int tag, T group) throws IOException - Throws:
IOException
-
computeGroupSize
-
writeMessage
protected static void writeMessage(CodedOutputStream output, int tag, BaseMessage message) throws IOException - Throws:
IOException
-
computeMessageSize
-
prefix
-
readRawVarint32
Read a raw Varint from the stream. If larger than 32 bits, discard the upper bits.- Throws:
IOException
-
readRawByte
- Throws:
IOException
-