public final class ByteType extends DataType
ADDRESS_TYPE, ARRAY_SUFFIX, CHARSET, CLASS_TYPE, EMPTY_STRING, FIELD_MASK_SIZE, INDENT, INDENT1, KEY_TYPE, MAX_ARRAY_SIZE, MAX_FIELDS, MAX_FILE_NAME_LENGTH, MAX_STRING_LENGTH, mBuiltinFlag, mClass, mDefaultValue, mSize, sClasses, sCompiledClasses, STRING_TYPE, VARIABLE_SIZE| Modifier and Type | Method and Description |
|---|---|
protected void |
createDeserializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output,
boolean useBuilder)
Generates the code to de-serialize the byte value
from a
ByteBuffer. |
protected void |
createSerializer(MessageType.MessageField field,
String fieldName,
String indent,
Formatter output)
Adds the Java code used to serialize the byte field to
a
ByteBuffer. |
Object |
deserialize(ByteBuffer buffer)
Returns the deserialized
Byte in
buffer. |
void |
serialize(Object o,
ByteBuffer buffer)
Serializes this byte to the given
buffer. |
compareTo, dataClass, dataClassName, defaultValue, equals, fields, findCharset, findType, hashCode, isArray, isBuiltin, isEnum, isInstance, isLocalOnly, isMessage, isPrimitive, replyClasses, size, toStringpublic void serialize(Object o, ByteBuffer buffer) throws BufferOverflowException
buffer.serialize in class DataTypeo - a Byte object.buffer - write to this buffer.BufferOverflowException - if buffer overflows.deserialize(ByteBuffer)public Object deserialize(ByteBuffer buffer) throws BufferUnderflowException
Byte in
buffer.deserialize in class DataTypebuffer - Deserialize the byte object from this
ByteBuffer.Byte.BufferUnderflowException - if buffer does not contain a single byte.serialize(java.lang.Object, java.nio.ByteBuffer)protected void createSerializer(MessageType.MessageField field, String fieldName, String indent, Formatter output)
ByteBuffer.createSerializer in class DataTypefield - message field.fieldName - the message field name.indent - indent the code by this amount.output - write the code to this formatter.protected void createDeserializer(MessageType.MessageField field, String fieldName, String indent, Formatter output, boolean useBuilder)
ByteBuffer.createDeserializer in class DataTypefield - message field.fieldName - store the de-serialized field in this
name.indent - indent the code by this amount.output - append the code to this formatter.useBuilder - if true then fieldName
is a builder method name; otherwise a local variable.Copyright © 2019. All rights reserved.