/**
  * Enter description here...
  * @throws SerializationException
  * 
  * @return void
  */
 public static function serialize(SerializationStreamWriter $streamWriter, $instance, MappedClass $instanceClass)
 {
     if ($instance instanceof Byte) {
         $streamWriter->writeByte($instance->byteValue());
     } else {
         $streamWriter->writeByte($instance);
     }
     //$streamWriter->writeByte($instance);
 }
 /**
  * 
  *
  * @param SerializationStreamWriter $streamWriter
  * @param unknown_type $instance
  * @throws SerializationException
  */
 public static function serialize(SerializationStreamWriter $streamWriter, $instance, MappedClass $instanceClass)
 {
     $itemCount = count($instance);
     $streamWriter->writeInt($itemCount);
     for ($itemIndex = 0; $itemIndex < $itemCount; ++$itemIndex) {
         $streamWriter->writeByte($instance[$itemIndex]);
     }
 }
 public static function serialize(SerializationStreamWriter $streamWriter, $instance)
 {
     $streamWriter->writeByte($instance->getValue());
 }