public abstract class ByteDecoder extends Object
| Constructor and Description | 
|---|
ByteDecoder()  | 
| Modifier and Type | Method and Description | 
|---|---|
abstract Object | 
createEmptyComposite(String sbeCompositeTypeName,
                    Object ref)
Creates or fills empty instance of the class that represents standard composite type. 
 | 
abstract <T> T | 
createEmptyCustomComposite(Class<T> cls)
Creates empty instance of the class that implements given custom composite interface. 
 | 
abstract IMessage | 
decode(byte[] data,
      int offset,
      int size)
This function does the following:
 1. 
 | 
abstract IMessage | 
decodePreCreatedMessage(byte[] data,
                       int offset,
                       int size)
This function does the following:
 1. 
 | 
abstract IMessage | 
encode(byte[] data,
      int offset,
      int size,
      int templateId)
This function does the following:
 1. 
 | 
abstract IMessage | 
encodePreCreatedMessage(byte[] data,
                       int offset,
                       int size,
                       int templateId)
This function does the following:
 1. 
 | 
abstract boolean | 
isNullComposite(String sbeCompositeTypeName,
               Object ref)
Checks the object of the standard composite type if it is null. 
 | 
public abstract IMessage decode(byte[] data, int offset, int size)
if header size field > size then returns null: can't read the message 
 2. Uses generated code by messageHeader to read messageHeader
 3. Creates message template
 4. Points this template to data buffer
 5. Returns message templatedata - - byte buffer with dataoffset - - start offset of the message.size - available data in buffer to decode.public abstract IMessage decodePreCreatedMessage(byte[] data, int offset, int size)
if header size field > size then returns null: can't read the message 
 2. Uses generated code by messageHeader to read messageHeader
 3. Selects right message template (templates are already created)
 4. Points this template to data buffer
 5. Returns message template
 WARNING: in next call of this method, returned message object can be reused.
 If you need to use returned message in another thread, please clone it or use decode method.data - - byte buffer with dataoffset - - start offset of the message.size - available data in buffer to decode.public abstract IMessage encode(byte[] data, int offset, int size, int templateId)
data - - byte buffer with dataoffset - - start offset of the message.size - available data in buffer to decode.templateId - message template id.public abstract IMessage encodePreCreatedMessage(byte[] data, int offset, int size, int templateId)
data - - byte buffer with dataoffset - - start offset of the message.size - available data in buffer to decode.templateId - message template id.public abstract <T> T createEmptyCustomComposite(Class<T> cls)
ByteDecoderFactory.create(MessageSchema, Class[]) method
 when the decoder was created.T - Class of the custom composite.cls - Class of the custom composite.public abstract Object createEmptyComposite(String sbeCompositeTypeName, Object ref)
ref == null. When ref != null a new object is not
 created but the input object is filled with the default values.
 The result type can be selected by its name if the ref == null. Otherwise, type of the ref
 parameter must correspond to the SBE composite type: ScaledDecimal to the decimal kind of type, etc.
 The returned value contains null value for the given type if this type provides such ability. When the
 type has no optional fields, the returned objectsbeCompositeTypeName - Name of the type as it mentioned in the SBE template.ref - Object of suitable standard composite type to fill with null value, or null/ref == null or the original ref.public abstract boolean isNullComposite(String sbeCompositeTypeName, Object ref)
sbeCompositeTypeName - SBE type name that is used to check content of the object.ref - Object to check.Copyright © 2005–2025 Onix Solutions. All rights reserved.