org.fusesource.hawtbuf.proto
Class BaseMessage<T>
java.lang.Object
org.fusesource.hawtbuf.proto.BaseMessage<T>
- All Implemented Interfaces:
- Message<T>
- Direct Known Subclasses:
- DeferredDecodeMessage
public abstract class BaseMessage<T>
- extends Object
- implements Message<T>
Method Summary |
protected static
|
addAll(Iterable<T> values,
Collection<? super T> list)
|
T |
assertInitialized()
|
protected T |
checktInitialized()
|
void |
clear()
|
abstract T |
clone()
|
protected static int |
computeGroupSize(int tag,
BaseMessage message)
|
protected static int |
computeMessageSize(int tag,
BaseMessage message)
|
boolean |
isInitialized()
|
protected void |
load()
|
protected void |
loadAndClear()
|
T |
mergeFramed(Buffer data)
|
T |
mergeFramed(byte[] data)
|
T |
mergeFramed(CodedInputStream input)
|
T |
mergeFramed(InputStream input)
|
T |
mergeFrom(T other)
|
T |
mergeUnframed(Buffer data)
|
T |
mergeUnframed(byte[] data)
|
T |
mergeUnframed(InputStream input)
|
ArrayList<String> |
missingFields()
|
protected List<String> |
prefix(List<String> missingFields,
String prefix)
|
protected static
|
readGroup(CodedInputStream input,
int tag,
T group)
|
protected static byte |
readRawByte(InputStream is)
|
static int |
readRawVarint32(InputStream is)
Read a raw Varint from the stream. |
int |
serializedSizeFramed()
|
Buffer |
toFramedBuffer()
|
byte[] |
toFramedByteArray()
|
Buffer |
toUnframedBuffer()
|
byte[] |
toUnframedByteArray()
|
void |
writeFramed(CodedOutputStream output)
|
void |
writeFramed(OutputStream output)
|
protected static void |
writeGroup(CodedOutputStream output,
int tag,
BaseMessage message)
|
protected static void |
writeMessage(CodedOutputStream output,
int tag,
BaseMessage message)
|
void |
writeUnframed(CodedOutputStream output)
|
void |
writeUnframed(OutputStream output)
|
memoizedSerializedSize
protected int memoizedSerializedSize
BaseMessage
public BaseMessage()
clone
public abstract T clone()
throws CloneNotSupportedException
- Specified by:
clone
in interface Message<T>
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
clear
public void clear()
- Specified by:
clear
in interface Message<T>
isInitialized
public boolean isInitialized()
assertInitialized
public T assertInitialized()
throws UninitializedMessageException
- Specified by:
assertInitialized
in interface Message<T>
- Throws:
UninitializedMessageException
checktInitialized
protected T checktInitialized()
throws InvalidProtocolBufferException
- Throws:
InvalidProtocolBufferException
missingFields
public ArrayList<String> missingFields()
loadAndClear
protected void loadAndClear()
load
protected void load()
mergeFrom
public T mergeFrom(T other)
- Specified by:
mergeFrom
in interface Message<T>
writeUnframed
public void writeUnframed(CodedOutputStream output)
throws IOException
- Specified by:
writeUnframed
in interface Message<T>
- Throws:
IOException
writeFramed
public void writeFramed(CodedOutputStream output)
throws IOException
- Specified by:
writeFramed
in interface Message<T>
- Throws:
IOException
toUnframedBuffer
public Buffer toUnframedBuffer()
- Specified by:
toUnframedBuffer
in interface Message<T>
toFramedBuffer
public Buffer toFramedBuffer()
- Specified by:
toFramedBuffer
in interface Message<T>
toUnframedByteArray
public byte[] toUnframedByteArray()
- Specified by:
toUnframedByteArray
in interface Message<T>
toFramedByteArray
public byte[] toFramedByteArray()
- Specified by:
toFramedByteArray
in interface Message<T>
writeFramed
public void writeFramed(OutputStream output)
throws IOException
- Specified by:
writeFramed
in interface Message<T>
- Throws:
IOException
writeUnframed
public void writeUnframed(OutputStream output)
throws IOException
- Specified by:
writeUnframed
in interface Message<T>
- Throws:
IOException
serializedSizeFramed
public int serializedSizeFramed()
- Specified by:
serializedSizeFramed
in interface Message<T>
mergeFramed
public T mergeFramed(CodedInputStream input)
throws IOException
- Specified by:
mergeFramed
in interface Message<T>
- Throws:
IOException
mergeUnframed
public T mergeUnframed(Buffer data)
throws InvalidProtocolBufferException
- Specified by:
mergeUnframed
in interface Message<T>
- Throws:
InvalidProtocolBufferException
mergeFramed
public T mergeFramed(Buffer data)
throws InvalidProtocolBufferException
- Specified by:
mergeFramed
in interface Message<T>
- Throws:
InvalidProtocolBufferException
mergeUnframed
public T mergeUnframed(byte[] data)
throws InvalidProtocolBufferException
- Specified by:
mergeUnframed
in interface Message<T>
- Throws:
InvalidProtocolBufferException
mergeFramed
public T mergeFramed(byte[] data)
throws InvalidProtocolBufferException
- Specified by:
mergeFramed
in interface Message<T>
- Throws:
InvalidProtocolBufferException
mergeUnframed
public T mergeUnframed(InputStream input)
throws IOException
- Specified by:
mergeUnframed
in interface Message<T>
- Throws:
IOException
mergeFramed
public T mergeFramed(InputStream input)
throws IOException
- Specified by:
mergeFramed
in interface Message<T>
- Throws:
IOException
addAll
protected static <T> void addAll(Iterable<T> values,
Collection<? super T> list)
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
protected static int computeGroupSize(int tag,
BaseMessage message)
writeMessage
protected static void writeMessage(CodedOutputStream output,
int tag,
BaseMessage message)
throws IOException
- Throws:
IOException
computeMessageSize
protected static int computeMessageSize(int tag,
BaseMessage message)
prefix
protected List<String> prefix(List<String> missingFields,
String prefix)
readRawVarint32
public static int readRawVarint32(InputStream is)
throws IOException
- Read a raw Varint from the stream. If larger than 32 bits, discard the
upper bits.
- Throws:
IOException
readRawByte
protected static byte readRawByte(InputStream is)
throws IOException
- Throws:
IOException
Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.