Package org.apache.activemq.protobuf
Class BaseMessage<T>
java.lang.Object
org.apache.activemq.protobuf.BaseMessage<T>
- All Implemented Interfaces:
Message<T>
- Direct Known Subclasses:
DeferredDecodeMessage
,MessageWithNoOuter
,MessageWithNoOuter.NestedMessage
,UnittestEmbedOptimizeFor.TestEmbedOptimizedForSize
,UnittestImport.ImportMessage
,UnittestMset.RawMessageSet
,UnittestMset.RawMessageSet.Item
,UnittestMset.TestMessageSet
,UnittestMset.TestMessageSetContainer
,UnittestMset.TestMessageSetExtension1
,UnittestMset.TestMessageSetExtension2
,UnittestOptimizeFor.TestOptimizedForSize
,UnittestProto.BarRequest
,UnittestProto.BarResponse
,UnittestProto.FooRequest
,UnittestProto.FooResponse
,UnittestProto.ForeignMessage
,UnittestProto.TestAllExtensions
,UnittestProto.TestAllTypes
,UnittestProto.TestAllTypes.NestedMessage
,UnittestProto.TestAllTypes.OptionalGroup
,UnittestProto.TestAllTypes.RepeatedGroup
,UnittestProto.TestCamelCaseFieldNames
,UnittestProto.TestDupFieldNumber
,UnittestProto.TestDupFieldNumber.Bar
,UnittestProto.TestDupFieldNumber.Foo
,UnittestProto.TestEmptyMessage
,UnittestProto.TestEmptyMessageWithExtensions
,UnittestProto.TestExtremeDefaultValues
,UnittestProto.TestFieldOrderings
,UnittestProto.TestForeignNested
,UnittestProto.TestMutualRecursionA
,UnittestProto.TestMutualRecursionB
,UnittestProto.TestNestedMessageHasBits
,UnittestProto.TestNestedMessageHasBits.NestedMessage
,UnittestProto.TestReallyLargeTagNumber
,UnittestProto.TestRecursiveMessage
,UnittestProto.TestRequired
,UnittestProto.TestRequiredForeign
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> void
addAll
(Iterable<T> values, Collection<? super T> list) protected T
void
clear()
abstract T
clone()
protected static int
computeGroupSize
(int tag, BaseMessage message) protected static int
computeMessageSize
(int tag, BaseMessage message) boolean
protected void
load()
protected void
mergeFramed
(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 byte
static int
Read a raw Varint from the stream.int
byte[]
byte[]
void
writeFramed
(OutputStream output) void
writeFramed
(CodedOutputStream output) protected static void
writeGroup
(CodedOutputStream output, int tag, BaseMessage message) protected static void
writeMessage
(CodedOutputStream output, int tag, BaseMessage message) void
writeUnframed
(OutputStream output) void
writeUnframed
(CodedOutputStream output) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.activemq.protobuf.Message
mergeUnframed, serializedSizeUnframed
-
Field Details
-
memoizedSerializedSize
protected int memoizedSerializedSize
-
-
Constructor Details
-
BaseMessage
public BaseMessage()
-
-
Method Details
-
clone
-
clear
public void clear() -
isInitialized
public boolean isInitialized() -
assertInitialized
- Specified by:
assertInitialized
in interfaceMessage<T>
- Throws:
UninitializedMessageException
-
checktInitialized
- Throws:
InvalidProtocolBufferException
-
missingFields
-
loadAndClear
protected void loadAndClear() -
load
protected void load() -
mergeFrom
-
writeUnframed
- Specified by:
writeUnframed
in interfaceMessage<T>
- Throws:
IOException
-
writeFramed
- Specified by:
writeFramed
in interfaceMessage<T>
- Throws:
IOException
-
toUnframedBuffer
- Specified by:
toUnframedBuffer
in interfaceMessage<T>
-
toFramedBuffer
- Specified by:
toFramedBuffer
in interfaceMessage<T>
-
toUnframedByteArray
public byte[] toUnframedByteArray()- Specified by:
toUnframedByteArray
in interfaceMessage<T>
-
toFramedByteArray
public byte[] toFramedByteArray()- Specified by:
toFramedByteArray
in interfaceMessage<T>
-
writeFramed
- Specified by:
writeFramed
in interfaceMessage<T>
- Throws:
IOException
-
writeUnframed
- Specified by:
writeUnframed
in interfaceMessage<T>
- Throws:
IOException
-
serializedSizeFramed
public int serializedSizeFramed()- Specified by:
serializedSizeFramed
in interfaceMessage<T>
-
mergeFramed
- Specified by:
mergeFramed
in interfaceMessage<T>
- Throws:
IOException
-
mergeUnframed
- Specified by:
mergeUnframed
in interfaceMessage<T>
- Throws:
InvalidProtocolBufferException
-
mergeFramed
- Specified by:
mergeFramed
in interfaceMessage<T>
- Throws:
InvalidProtocolBufferException
-
mergeUnframed
- Specified by:
mergeUnframed
in interfaceMessage<T>
- Throws:
InvalidProtocolBufferException
-
mergeFramed
- Specified by:
mergeFramed
in interfaceMessage<T>
- Throws:
InvalidProtocolBufferException
-
mergeUnframed
- Specified by:
mergeUnframed
in interfaceMessage<T>
- Throws:
IOException
-
mergeFramed
- Specified by:
mergeFramed
in 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
-