# ActorObjectSerializer (dapr-sdk-parent 1.10.0 API)

Package io.dapr.actors.runtime

## Class ActorObjectSerializer

- java.lang.Object
- - io.dapr.client.ObjectSerializer
  - - io.dapr.actors.runtime.ActorObjectSerializer

    public class ActorObjectSerializer
    extends ObjectSerializer

Serializes and deserializes internal objects.

### Field Summary

### Fields inherited from class io.dapr.client.ObjectSerializer

`OBJECT_MAPPER`

### Constructor Summary

Constructors
`ActorObjectSerializer()`

### Method Summary

All Methods Instance Methods Concrete Methods
`<T> T` `deserialize​(byte[] content, Class<T> clazz)` Deserializes the byte array into the original object.
`byte[]` `serialize​(Object state)` Serializes a given state object into byte array.

### Methods inherited from class io.dapr.client.ObjectSerializer

`deserialize, parseNode`

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### ActorObjectSerializer

    public ActorObjectSerializer()

### Method Detail

#### serialize

    public byte[] serialize​(Object state)
                     throws IOException

Serializes a given state object into byte array.

Overrides:
  `serialize` in class `ObjectSerializer`
Parameters:
  `state` - State object to be serialized.
Returns:
  Array of bytes[] with the serialized content.
Throws:
  `IOException` - In case state cannot be serialized.

#### deserialize

    public <T> T deserialize​(byte[] content,
                             Class<T> clazz)
                      throws IOException

Deserializes the byte array into the original object.

Overrides:
  `deserialize` in class `ObjectSerializer`
Type Parameters:
  `T` - Generic type of the object being deserialized.
Parameters:
  `content` - Content to be parsed.
  `clazz` - Type of the object being deserialized.
Returns:
  Object of type T.
Throws:
  `IOException` - In case content cannot be deserialized.