Gives back the serialized LogRecord as arrays of bytes.
Unless overriden this simply serializes the Log Record.

@return ObjectManagerByteArrayOutputStream[] the buffers containing the serialized LogRecord.
@throws ObjectManagerException
333478
protected ObjectManagerByteArrayOutputStream[] getBuffers()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "getBuffers"
                            );

        // Default log record behaviour.
        // -----------------------------

        // Captute the serialized Log Record.
        ObjectManagerByteArrayOutputStream serializedLogRecord = serialize(this);
        // Create an array for the header and the serialized ManagedObject.
        ObjectManagerByteArrayOutputStream[] buffers = new ObjectManagerByteArrayOutputStream[2];

        // We dont add a version to each logRecord, but use the logHeader version to enable
        // forward migration by assuming all logRecords in the log ore appropriate the the version of the
        // header.
        // Create the buffer to contain the header for this log record.
        buffers[0] = new ObjectManagerByteArrayOutputStream(4 // Log Record Type.
                                                            + 8);
        buffers[0].writeInt(LogRecord.TYPE_USER_DEFINED);
        buffers[0].writeLong(serializedLogRecord.getCount());

        // Now add a buffer containing the serialzed Log Record itself. 
        buffers[1] = serializedLogRecord;

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "getBuffers"
                       , "returns buffers=" + buffers + "(byte[][])"
                            );
        return buffers;
    }
536122
public function serialize()
    {
        $data = array();

        foreach (get_object_vars($this) as $propertyName => $propertyValue) {
            $data[$propertyName] = $propertyValue;
        }

        return serialize($data);
    }
822447
public function toArray()
    {
        list($rawData, $rawIncludedData) = $this->executeResourceTransformers();

        $serializer = $this->manager->getSerializer();

        $data = $this->serializeResource($serializer, $rawData);

        // If the serializer wants the includes to be side-loaded then we'll
        // serialize the included data and merge it with the data.
        if ($serializer->sideloadIncludes()) {
            //Filter out any relation that wasn't requested
            $rawIncludedData = array_map(array($this, 'filterFieldsets'), $rawIncludedData);

            $includedData = $serializer->includedData($this->resource, $rawIncludedData);

            // If the serializer wants to inject additional information
            // about the included resources, it can do so now.
            $data = $serializer->injectData($data, $rawIncludedData);

            if ($this->isRootScope()) {
                // If the serializer wants to have a final word about all
                // the objects that are sideloaded, it can do so now.
                $includedData = $serializer->filterIncludes(
                    $includedData,
                    $data
                );
            }

            $data = $data + $includedData;
        }

        if ($this->resource instanceof Collection) {
            if ($this->resource->hasCursor()) {
                $pagination = $serializer->cursor($this->resource->getCursor());
            } elseif ($this->resource->hasPaginator()) {
                $pagination = $serializer->paginator($this->resource->getPaginator());
            }

            if (! empty($pagination)) {
                $this->resource->setMetaValue(key($pagination), current($pagination));
            }
        }

        // Pull out all of OUR metadata and any custom meta data to merge with the main level data
        $meta = $serializer->meta($this->resource->getMeta());

        // in case of returning NullResource we should return null and not to go with array_merge
        if (is_null($data)) {
            if (!empty($meta)) {
                return $meta;
            }
            return null;
        }

        return $data + $meta;
    }
329968
public static byte[] serialize(FastSerializable object) throws IOException {
        FastSerializer out = new FastSerializer();
        object.writeExternal(out);
        return out.getBBContainer().b().array();
    }
1023756
public Object[] toArray() {
		XEvent array[] = new XEvent[events.size()];
		for (int i = 0; i < events.size(); i++) {
			try {
				array[i] = events.get(i);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return array;
	}
368959
public static byte[] getBytes(Object obj) throws IOException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream oos = new ObjectOutputStream(bos);
		oos.writeObject(obj);
		oos.flush();
		oos.close();
		bos.close();
		byte[] data = bos.toByteArray();
		return data;
	}
1043480
public function toArray()
    {
        return array_map(static function ($value) {
            if ($value instanceof ArraySerializableInterface) {
                $value = $value->toArray();
            }
            return $value;
        }, get_object_vars($this));
    }
1281942
public function toRecords()
    {
        $result = [];

        while ($chunk = $this->error->read(65535)) {
            $result[] = new Record(new Header(RecordType::stderr(), $this->requestId, strlen($chunk)), $chunk);
        }

        while ($chunk = $this->content->read(65535)) {
            $result[] = new Record(new Header(RecordType::stdout(), $this->requestId, strlen($chunk)), $chunk);
        }
        $result[] = new Record(new Header(RecordType::stdout(), $this->requestId, 0, 8), '');

        $result[] = new Record(new Header(RecordType::endRequest(), $this->requestId, 0, 8), '');

        return new ArrayIterator($result);
    }
1135865
public function serialize(): array {
        // base 64 encode
        $details = array_map(function($value) {
            return base64_encode($value);
        }, $this->details);

        // enrich with encryption type
        return $details + ['encryption' => $this->encryption];
    }
500478
public static function serialize () {
		$data = [];
		foreach (static::$multitonInstances as $name => $instance) {
			$data[$name] = serialize($instance);
		}
		return serialize($data);
	}
210914
public function jsonSerialize() {
		$json = array();

		foreach(get_object_vars($this) as $var => $val) {
			if($val instanceof \DateTime)
				$json[$var] = $val->getTimestamp();
			else
				$json[$var] = $val;
		}

		return $json;
	}
1152327
public Object[] nextRecord() {
        try {
            int nextByte;
            do {
                nextByte = dataInput.readByte();
                if (nextByte == DATA_ENDED) {
                    return null;
                } else if (nextByte == DATA_DELETED) {
                    dataInput.skipBytes(header.getRecordLength() - 1);
                }
            } while (nextByte == DATA_DELETED);

            Object recordObjects[] = new Object[header.getFieldsCount()];
            for (int i = 0; i < header.getFieldsCount(); i++) {
                recordObjects[i] = readFieldValue(header.getField(i));
            }
            return recordObjects;
        } catch (EOFException e) {
            return null; // we currently end reading file
        } catch (IOException e) {
            throw new DbfException("Cannot read next record form Dbf file", e);
        }
    }
770501
public function serialize()
    {
        $data = array(
            // Serialized data ID.
            self::VERSION,
            $this->_headers->getArrayCopy(),
            // TODO: BC
            $this->_eol
        );

        return serialize($data);
    }
86117
public Object[][] getContents()
  {
    return new Object[][] {

  /** Error message ID that has a null message, but takes in a single object.    */
    {"ER0000" , "{0}" },
 
    { ER_FUNCTION_NOT_SUPPORTED, 
      "Function not supported!"},

    { ER_CANNOT_OVERWRITE_CAUSE,
      "Cannot overwrite cause"},

    { ER_NO_DEFAULT_IMPL,
      "No default implementation found "},

    { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
      "ChunkedIntArray({0}) not currently supported"},

    { ER_OFFSET_BIGGER_THAN_SLOT,
      "Offset bigger than slot"},

    { ER_COROUTINE_NOT_AVAIL,
      "Coroutine not available, id={0}"},
    
    { ER_COROUTINE_CO_EXIT,
      "CoroutineManager received co_exit() request"},

    { ER_COJOINROUTINESET_FAILED,
      "co_joinCoroutineSet() failed"},

    { ER_COROUTINE_PARAM,
      "Coroutine parameter error ({0})"},

    { ER_PARSER_DOTERMINATE_ANSWERS,
      "\nUNEXPECTED: Parser doTerminate answers {0}"},

    { ER_NO_PARSE_CALL_WHILE_PARSING,
      "parse may not be called while parsing"},

    { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
      "Error: typed iterator for axis  {0} not implemented"},

    { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
      "Error: iterator for axis {0} not implemented "},

    { ER_ITERATOR_CLONE_NOT_SUPPORTED,
      "Iterator clone not supported"},

    { ER_UNKNOWN_AXIS_TYPE,
      "Unknown axis traversal type: {0}"},

    { ER_AXIS_NOT_SUPPORTED,
      "Axis traverser not supported: {0}"},

    { ER_NO_DTMIDS_AVAIL,
      "No more DTM IDs are available"},

    { ER_NOT_SUPPORTED,
      "Not supported: {0}"},
    
    { ER_NODE_NON_NULL,
      "Node must be non-null for getDTMHandleFromNode"},

    { ER_COULD_NOT_RESOLVE_NODE,
      "Could not resolve the node to a handle"},

    { ER_STARTPARSE_WHILE_PARSING,
       "startParse may not be called while parsing"},

    { ER_STARTPARSE_NEEDS_SAXPARSER,
       "startParse needs a non-null SAXParser"},

    { ER_COULD_NOT_INIT_PARSER,
       "could not initialize parser with"},

    { ER_EXCEPTION_CREATING_POOL,
       "exception creating new instance for pool"},

    { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
       "Path contains invalid escape sequence"},

    { ER_SCHEME_REQUIRED,
       "Scheme is required!"},
    
    { ER_NO_SCHEME_IN_URI,
       "No scheme found in URI: {0}"},

    { ER_NO_SCHEME_INURI,
       "No scheme found in URI"},

    { ER_PATH_INVALID_CHAR,
       "Path contains invalid character: {0}"},

    { ER_SCHEME_FROM_NULL_STRING,
       "Cannot set scheme from null string"},

    { ER_SCHEME_NOT_CONFORMANT,
       "The scheme is not conformant."},

    { ER_HOST_ADDRESS_NOT_WELLFORMED,
       "Host is not a well formed address"},

    { ER_PORT_WHEN_HOST_NULL,
       "Port cannot be set when host is null"},

    { ER_INVALID_PORT,
       "Invalid port number"},

    { ER_FRAG_FOR_GENERIC_URI,
       "Fragment can only be set for a generic URI"},

    { ER_FRAG_WHEN_PATH_NULL,
       "Fragment cannot be set when path is null"},

    { ER_FRAG_INVALID_CHAR,
       "Fragment contains invalid character"},

    { ER_PARSER_IN_USE,
      "Parser is already in use"},

    { ER_CANNOT_CHANGE_WHILE_PARSING,
      "Cannot change {0} {1} while parsing"},
   
    { ER_SELF_CAUSATION_NOT_PERMITTED,
      "Self-causation not permitted"},

    { ER_NO_USERINFO_IF_NO_HOST,
      "Userinfo may not be specified if host is not specified"},

    { ER_NO_PORT_IF_NO_HOST,
      "Port may not be specified if host is not specified"},

    { ER_NO_QUERY_STRING_IN_PATH, 
      "Query string cannot be specified in path and query string"},

    { ER_NO_FRAGMENT_STRING_IN_PATH,
      "Fragment cannot be specified in both the path and fragment"},

    { ER_CANNOT_INIT_URI_EMPTY_PARMS, 
      "Cannot initialize URI with empty parameters"},

    { ER_METHOD_NOT_SUPPORTED,
      "Method not yet supported "},
    
    { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
      "IncrementalSAXSource_Filter not currently restartable"},

    { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
      "XMLReader not before startParse request"},

    { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
      "Axis traverser not supported: {0}"},

    { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
      "ListingErrorHandler created with null PrintWriter!"},

    { ER_SYSTEMID_UNKNOWN,
      "SystemId Unknown"},

    { ER_LOCATION_UNKNOWN,
      "Location of error unknown"},

    { ER_PREFIX_MUST_RESOLVE,
      "Prefix must resolve to a namespace: {0}"},

    { ER_CREATEDOCUMENT_NOT_SUPPORTED,
      "createDocument() not supported in XPathContext!"},

    { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
      "Attribute child does not have an owner document!"},

    { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
      "Attribute child does not have an owner document element!"},

    { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
      "Warning: can't output text before document element!  Ignoring..."},

    { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
      "Can't have more than one root on a DOM!"},

    { ER_ARG_LOCALNAME_NULL,
       "Argument 'localName' is null"},
 
    // Note to translators:  A QNAME has the syntactic form [NCName:]NCName
    // The localname is the portion after the optional colon; the message indicates
    // that there is a problem with that part of the QNAME.
    { ER_ARG_LOCALNAME_INVALID,
       "Localname in QNAME should be a valid NCName"},

    // Note to translators:  A QNAME has the syntactic form [NCName:]NCName
    // The prefix is the portion before the optional colon; the message indicates
    // that there is a problem with that part of the QNAME.
    { ER_ARG_PREFIX_INVALID,
       "Prefix in QNAME should be a valid NCName"},
       
    { ER_NAME_CANT_START_WITH_COLON,
      "Name cannot start with a colon"},
       
    { "BAD_CODE", "Parameter to createMessage was out of bounds"},
    { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
    { "line", "Line #"},
    { "column","Column #"}
  
  
  };
  }
382870
public function serialize()
    {
        if ($this->getIsModified() || $this->getIsNew()) {
            throw new RuntimeException($this->translate(
                'Cannot serialize modified or new object.'
            ));
        }

        if ($this->collection && $this->type) {
            $this->fullyLoad(true);
        }
        $data = [
            $this->initialValues,
            $this->getCollectionName(),
            $this->getTypeName()
        ];

        return serialize($data);
    }
1017672
public function serialize()
    {
        $result = [
            'code' => $this->getCode(),
            'message' => $this->getMessage(),
            'errors' => $this->getErrors()
        ];

        $result['data'] = $this->getVariables();

        if ($result['data'] instanceof Traversable) {
            $result['data'] = ArrayUtils::iteratorToArray($result['data']);
        }

        if (null !== $this->jsonpCallback) {
            return $this->jsonpCallback . '(' . Json::encode($result) . ');';
        }

        return Json::encode($result);
    }
777895
public function serialize()
    {
        $objectData = array();

        foreach ($this as $propertyName => $propertyValue)
        {
            if (    is_scalar($propertyValue)
                ||  is_array($propertyValue)
                ||  $propertyValue instanceof Serializable)
            {
                $objectData[$propertyName] = $propertyValue;
            }
        }

        return serialize($objectData);
    }