# Class RbSerializer

java.lang.Object
net.sf.robocode.serialization.RbSerializer

public final class RbSerializer extends Object

Author:
  Pavel Savara (original)

## Field Summary

Fields
Modifier and Type
Field
Description
`static final byte`
`BattleEndedEvent_TYPE`
`static final byte`
`BattleResults_TYPE`
`static final byte`
`Bullet_TYPE`
`static final byte`
`BulletCommand_TYPE`
`static final byte`
`BulletHitBulletEvent_TYPE`
`static final byte`
`BulletHitEvent_TYPE`
`static final byte`
`BulletMissedEvent_TYPE`
`static final byte`
`BulletStatus_TYPE`
`static final byte`
`DeathEvent_TYPE`
`static final byte`
`DebugProperty_TYPE`
`static final byte`
`ExecCommands_TYPE`
`static final byte`
`ExecResults_TYPE`
`static final byte`
`HitByBulletEvent_TYPE`
`static final byte`
`HitRobotEvent_TYPE`
`static final byte`
`HitWallEvent_TYPE`
`static final byte`
`KeyPressedEvent_TYPE`
`static final byte`
`KeyReleasedEvent_TYPE`
`static final byte`
`KeyTypedEvent_TYPE`
`static final byte`
`MouseClickedEvent_TYPE`
`static final byte`
`MouseDraggedEvent_TYPE`
`static final byte`
`MouseEnteredEvent_TYPE`
`static final byte`
`MouseExitedEvent_TYPE`
`static final byte`
`MouseMovedEvent_TYPE`
`static final byte`
`MousePressedEvent_TYPE`
`static final byte`
`MouseReleasedEvent_TYPE`
`static final byte`
`MouseWheelMovedEvent_TYPE`
`static final byte`
`RobotDeathEvent_TYPE`
`static final byte`
`RobotStatics_TYPE`
`static final byte`
`RobotStatus_TYPE`
`static final byte`
`RoundEndedEvent_TYPE`
`static final byte`
`ScannedRobotEvent_TYPE`
`static final int`
`SIZEOF_BOOL`
`static final int`
`SIZEOF_BYTE`
`static final int`
`SIZEOF_CHAR`
`static final int`
`SIZEOF_DOUBLE`
`static final int`
`SIZEOF_INT`
`static final int`
`SIZEOF_LONG`
`static final int`
`SIZEOF_TYPEINFO`
`static final byte`
`SkippedTurnEvent_TYPE`
`static final byte`
`TeamMessage_TYPE`
`static final byte`
`TERMINATOR_TYPE`
`static final byte`
`WinEvent_TYPE`

## Constructor Summary

Constructors
Constructor
Description
`RbSerializer()`

## Method Summary

Modifier and Type
Method
Description
`static Object`
`deepCopy(byte type, Object src)`
`Object`
`deserialize(InputStream source)`
`Object`
`deserialize(ByteBuffer buffer)`
`Object`
`deserializeAny(ByteBuffer buffer)`
`boolean`
`deserializeBoolean(ByteBuffer buffer)`
`byte[]`
`deserializeBytes(ByteBuffer buffer)`
`char`
`deserializeChar(ByteBuffer buffer)`
`char[]`
`deserializeChars(ByteBuffer buffer)`
`double`
`deserializeDouble(ByteBuffer buffer)`
`double[]`
`deserializeDoubles(ByteBuffer buffer)`
`Float`
`deserializeFloat(ByteBuffer buffer)`
`float[]`
`deserializeFloats(ByteBuffer buffer)`
`static <T> T`
`deserializeFromBuffer(ByteBuffer buffer)`
`int`
`deserializeInt(ByteBuffer buffer)`
`int[]`
`deserializeIntegers(ByteBuffer buffer)`
`long`
`deserializeLong(ByteBuffer buffer)`
`String`
`deserializeString(ByteBuffer buffer)`
`static void`
`register(Class<?> realClass, byte type)`
`ByteBuffer`
`serialize(byte type, Object object)`
`void`
`serialize(OutputStream target, byte type, Object object)`
`void`
`serialize(ByteBuffer buffer, boolean value)`
`void`
`serialize(ByteBuffer buffer, byte[] data)`
`void`
`serialize(ByteBuffer buffer, byte type, Object object)`
`void`
`serialize(ByteBuffer buffer, char value)`
`void`
`serialize(ByteBuffer buffer, char[] data)`
`void`
`serialize(ByteBuffer buffer, double value)`
`void`
`serialize(ByteBuffer buffer, double[] data)`
`void`
`serialize(ByteBuffer buffer, float[] data)`
`void`
`serialize(ByteBuffer buffer, int value)`
`void`
`serialize(ByteBuffer buffer, int[] data)`
`void`
`serialize(ByteBuffer buffer, long value)`
`void`
`serialize(ByteBuffer buffer, String data)`
`void`
`serialize(ByteBuffer buffer, Event event)`
`static ByteBuffer`
`serializeToBuffer(Object src)`
`ByteBuffer`
`serializeToBuffer(ByteBuffer buffer, byte type, Object object)`
`int`
`sizeOf(byte[] data)`
`int`
`sizeOf(byte type, Object object)`
`int`
`sizeOf(String data)`
`int`
`sizeOf(Event event)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SIZEOF_TYPEINFO

public static final int SIZEOF_TYPEINFO

See Also:
  - Constant Field Values

### SIZEOF_BYTE

public static final int SIZEOF_BYTE

See Also:
  - Constant Field Values

### SIZEOF_BOOL

public static final int SIZEOF_BOOL

See Also:
  - Constant Field Values

### SIZEOF_CHAR

public static final int SIZEOF_CHAR

See Also:
  - Constant Field Values

### SIZEOF_INT

public static final int SIZEOF_INT

See Also:
  - Constant Field Values

### SIZEOF_LONG

public static final int SIZEOF_LONG

See Also:
  - Constant Field Values

### SIZEOF_DOUBLE

public static final int SIZEOF_DOUBLE

See Also:
  - Constant Field Values

### TERMINATOR_TYPE

public static final byte TERMINATOR_TYPE

See Also:
  - Constant Field Values

### ExecCommands_TYPE

public static final byte ExecCommands_TYPE

See Also:
  - Constant Field Values

### BulletCommand_TYPE

public static final byte BulletCommand_TYPE

See Also:
  - Constant Field Values

### TeamMessage_TYPE

public static final byte TeamMessage_TYPE

See Also:
  - Constant Field Values

### DebugProperty_TYPE

public static final byte DebugProperty_TYPE

See Also:
  - Constant Field Values

### ExecResults_TYPE

public static final byte ExecResults_TYPE

See Also:
  - Constant Field Values

### RobotStatus_TYPE

public static final byte RobotStatus_TYPE

See Also:
  - Constant Field Values

### BulletStatus_TYPE

public static final byte BulletStatus_TYPE

See Also:
  - Constant Field Values

### BattleResults_TYPE

public static final byte BattleResults_TYPE

See Also:
  - Constant Field Values

### Bullet_TYPE

public static final byte Bullet_TYPE

See Also:
  - Constant Field Values

### RobotStatics_TYPE

public static final byte RobotStatics_TYPE

See Also:
  - Constant Field Values

### BattleEndedEvent_TYPE

public static final byte BattleEndedEvent_TYPE

See Also:
  - Constant Field Values

### BulletHitBulletEvent_TYPE

public static final byte BulletHitBulletEvent_TYPE

See Also:
  - Constant Field Values

### BulletHitEvent_TYPE

public static final byte BulletHitEvent_TYPE

See Also:
  - Constant Field Values

### BulletMissedEvent_TYPE

public static final byte BulletMissedEvent_TYPE

See Also:
  - Constant Field Values

### DeathEvent_TYPE

public static final byte DeathEvent_TYPE

See Also:
  - Constant Field Values

### WinEvent_TYPE

public static final byte WinEvent_TYPE

See Also:
  - Constant Field Values

### HitWallEvent_TYPE

public static final byte HitWallEvent_TYPE

See Also:
  - Constant Field Values

### RobotDeathEvent_TYPE

public static final byte RobotDeathEvent_TYPE

See Also:
  - Constant Field Values

### SkippedTurnEvent_TYPE

public static final byte SkippedTurnEvent_TYPE

See Also:
  - Constant Field Values

### ScannedRobotEvent_TYPE

public static final byte ScannedRobotEvent_TYPE

See Also:
  - Constant Field Values

### HitByBulletEvent_TYPE

public static final byte HitByBulletEvent_TYPE

See Also:
  - Constant Field Values

### HitRobotEvent_TYPE

public static final byte HitRobotEvent_TYPE

See Also:
  - Constant Field Values

### KeyPressedEvent_TYPE

public static final byte KeyPressedEvent_TYPE

See Also:
  - Constant Field Values

### KeyReleasedEvent_TYPE

public static final byte KeyReleasedEvent_TYPE

See Also:
  - Constant Field Values

### KeyTypedEvent_TYPE

public static final byte KeyTypedEvent_TYPE

See Also:
  - Constant Field Values

### MouseClickedEvent_TYPE

public static final byte MouseClickedEvent_TYPE

See Also:
  - Constant Field Values

### MouseDraggedEvent_TYPE

public static final byte MouseDraggedEvent_TYPE

See Also:
  - Constant Field Values

### MouseEnteredEvent_TYPE

public static final byte MouseEnteredEvent_TYPE

See Also:
  - Constant Field Values

### MouseExitedEvent_TYPE

public static final byte MouseExitedEvent_TYPE

See Also:
  - Constant Field Values

### MouseMovedEvent_TYPE

public static final byte MouseMovedEvent_TYPE

See Also:
  - Constant Field Values

### MousePressedEvent_TYPE

public static final byte MousePressedEvent_TYPE

See Also:
  - Constant Field Values

### MouseReleasedEvent_TYPE

public static final byte MouseReleasedEvent_TYPE

See Also:
  - Constant Field Values

### MouseWheelMovedEvent_TYPE

public static final byte MouseWheelMovedEvent_TYPE

See Also:
  - Constant Field Values

### RoundEndedEvent_TYPE

public static final byte RoundEndedEvent_TYPE

See Also:
  - Constant Field Values

## Constructor Details

### RbSerializer

public RbSerializer()

## Method Details

### serialize

public void serialize(OutputStream target, byte type, Object object) throws IOException

Throws:
  `IOException`

### serialize

public ByteBuffer serialize(byte type, Object object) throws IOException

Throws:
  `IOException`

### serializeToBuffer

public ByteBuffer serializeToBuffer(ByteBuffer buffer, byte type, Object object) throws IOException

Throws:
  `IOException`

### deserialize

public Object deserialize(InputStream source) throws IOException

Throws:
  `IOException`

### deserialize

public Object deserialize(ByteBuffer buffer) throws IOException

Throws:
  `IOException`

### serialize

public void serialize(ByteBuffer buffer, byte type, Object object)

### serialize

public void serialize(ByteBuffer buffer, String data)

### serialize

public void serialize(ByteBuffer buffer, byte[] data)

### serialize

public void serialize(ByteBuffer buffer, int[] data)

### serialize

public void serialize(ByteBuffer buffer, char[] data)

### serialize

public void serialize(ByteBuffer buffer, double[] data)

### serialize

public void serialize(ByteBuffer buffer, float[] data)

### serialize

public void serialize(ByteBuffer buffer, boolean value)

### serialize

public void serialize(ByteBuffer buffer, double value)

### serialize

public void serialize(ByteBuffer buffer, char value)

### serialize

public void serialize(ByteBuffer buffer, long value)

### serialize

public void serialize(ByteBuffer buffer, int value)

### serialize

public void serialize(ByteBuffer buffer, Event event)

### deserializeAny

public Object deserializeAny(ByteBuffer buffer)

### deserializeString

public String deserializeString(ByteBuffer buffer)

### deserializeBytes

public byte[] deserializeBytes(ByteBuffer buffer)

### deserializeIntegers

public int[] deserializeIntegers(ByteBuffer buffer)

### deserializeFloats

public float[] deserializeFloats(ByteBuffer buffer)

### deserializeChars

public char[] deserializeChars(ByteBuffer buffer)

### deserializeDoubles

public double[] deserializeDoubles(ByteBuffer buffer)

### deserializeBoolean

public boolean deserializeBoolean(ByteBuffer buffer)

### deserializeChar

public char deserializeChar(ByteBuffer buffer)

### deserializeInt

public int deserializeInt(ByteBuffer buffer)

### deserializeFloat

public Float deserializeFloat(ByteBuffer buffer)

### deserializeDouble

public double deserializeDouble(ByteBuffer buffer)

### deserializeLong

public long deserializeLong(ByteBuffer buffer)

### sizeOf

public int sizeOf(String data)

### sizeOf

public int sizeOf(byte[] data)

### sizeOf

public int sizeOf(byte type, Object object)

### sizeOf

public int sizeOf(Event event)

### register

public static void register(Class<?> realClass, byte type)

### serializeToBuffer

public static ByteBuffer serializeToBuffer(Object src) throws IOException

Throws:
  `IOException`

### deserializeFromBuffer

public static <T> T deserializeFromBuffer(ByteBuffer buffer) throws IOException

Throws:
  `IOException`

### deepCopy

public static Object deepCopy(byte type, Object src)