You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

 

Purpose 

The purpose of this document to describe serialization of a various data type which Geode understands. 

Data Types

Geode supports all the Java primitive data types. Custom Java object can be serialized through Geode PdxSerializable and DataSerializable interfaces. The Application can attach its own data serializer through Geode DataSerializer and Geode PdxSerializer interface. Using Geode, the application can also serialize arrays of primitive java types and java collections. It also understands the Java Serializable.

In Geode, every supported data type is associated with type Id. Type Id is represented by one byte. To serialize any date type Geode first writes the typeId. Then it writes the length of serialized byte for variable types. For fixed data types it just write those bytes in the Big Indian byte order.

 

Data TypeType IdValueSerialized BytesDescription
Null41 = 0x29null
typeId0x29
 
Boolean 53 = 0x35true
typeId0x35
bytes0x01
 
Character 54 = 0x36'a'
typeId0x36
bytes

0x00 0x61

 
Byte 55 = 0x371
typeId0x37
bytes0x01
 
Short 56 = 0x381000
typeId0x38
bytes0x03 0xE8
 
Integer 57 = 0x391000
typeId0x39
bytes0x00 0x00 0x03 0xE8
 
Long 58 = 0x3A1000
typeId0x3A
bytes0x00 0x00 0x00 0x00 0x00 0x00 0x03 0xE8
 
Float 59 = 0x3B1000f
typeId0x3B
bytes

0x44 0x7A 0x00 0x00

 
Double 60 = 0x3C1000d



typeId0x3C
bytes

0x40 0xF1 0x40 0x00 0x00 0x00 0x00 0x00

 
String87 = 0x57"hello"
typeid0x57
len0x00 0x05
bytes0x68 0x65 0x40 0x40 0x6F
 
UTF_STRING 42 = 0x2A   
HUGE_STRING 88 = 0x58   
HUGE_UTF_STRING 89 = 0x59   
byte[] 46 = 0x2E 
typeId0x2E
  
 
short[]47 = 0x2F 
typeId0x2F
  
 
int[]48 = 0x30 
typeId0x30
  
 
long[]49 = 0x31 
typeId0x31
  
 
float[]50 = 0x32 
typeId0x32
  
 
double[]51 = 0x33 
typeId0x33
  
 
string[]64 = 0x40 
typeId0x40
  
 
Map67 = 0x43 
typeId0x43
  
 
Set66 = 0x42 
typeId0x42
  
 
List  
  
  
 
ArrayList  
  
  
 
PDX_SERIALIZATION    
PDX_SERIALIZER    
DATA_SERIALIZATION     
USER_SERIALIZATION     
  • No labels