def ToArray(value):
        """
        Serialize the given `value` to a an array of bytes.

        Args:
            value (neo.IO.Mixins.SerializableMixin): object extending SerializableMixin.

        Returns:
            bytes: hex formatted bytes
        """
        ms = StreamManager.GetStream()
        writer = BinaryWriter(ms)

        value.Serialize(writer)

        retVal = ms.ToArray()
        StreamManager.ReleaseStream(ms)

        return retVal
def ToArray ( value ) : ms = StreamManager . GetStream ( ) writer = BinaryWriter ( ms ) value . Serialize ( writer ) retVal = ms . ToArray ( ) StreamManager . ReleaseStream ( ms ) return retVal
Serialize the given `value` to a an array of bytes.

        Args:
            value (neo.IO.Mixins.SerializableMixin): object extending SerializableMixin.

        Returns:
            bytes: hex formatted bytes