############### Serialization ###################
967218
@Override
    public int[] read(ScanBuffer buffer) {
        int length = getLength(buffer);
        if (length<0) return null;
        return buffer.getInts(length);
    }
566503
@Override
	protected void serializeTo(RawDataBuffer out)
    {
    	super.serializeTo(out);
        out.writeInt(consumerId.asInt());
    }
1328565
protected function serialize()
	{
		// Remove the first token, which should be T_OPEN_TAG, aka "<?php"
		unset($this->tokens[0]);

		$php = '';
		foreach ($this->tokens as $token)
		{
			$php .= (is_string($token)) ? $token : $token[1];
		}

		return $php;
	}
17235
public function serialize()
    {
        $str = $this->name;
        if ($this->group) {
            $str = $this->group.'.'.$this->name;
        }

        foreach ($this->parameters() as $param) {
            $str .= ';'.$param->serialize();
        }

        $str .= ':'.$this->getRawMimeDirValue();

        $str = \preg_replace(
            '/(
                (?:^.)?         # 1 additional byte in first line because of missing single space (see next line)
                .{1,74}         # max 75 bytes per line (1 byte is used for a single space added after every CRLF)
                (?![\x80-\xbf]) # prevent splitting multibyte characters
            )/x',
            "$1\r\n ",
            $str
        );

        // remove single space after last CRLF
        return \substr($str, 0, -1);
    }
86193
function __serializeArray(data, options=DEFAULT_OPTIONS) {
	let dataBuffers = [];
	// ignore undefined value
	for (let key in data) {
		let subData = data[key];
		let subType = __getType(subData, options);
		let subTypeBuffer = __serializeType(subType);
		let subDataBuffers = __serializeData(subType, subData, options);
		dataBuffers.push(subTypeBuffer, ...subDataBuffers);
	}
	let length = __getLengthByArrayBuffers(dataBuffers);
	let lengthData = new Uint32Array([length]);
	return [lengthData.buffer, ...dataBuffers];
}
292786
public function serialize()
    {
        // @codingStandardsIgnoreStart
        unset($this->inspector, $this->___mocked);
        // @codingStandardsIgnoreEnd
        $keys = array_keys(get_object_vars($this));
        $data = [];
        foreach ($keys as $key) {
            $data[$key] = $this->$key;
        }
        return serialize($data);
    }
83762
function jsonSerialize() {
		$array = $this->toArray();
		foreach (static::$_columns as $column_name => &$type) {
			if (!isset($array[$column_name])) {
				continue;
			}
			$value = &$array[$column_name];

			if ($type === Model::COLUMN_TYPE_BOOLEAN) {
				if (0 === $value) {
					$value = false;
				} elseif (1 === $value) {
					$value = true;
				}
			} else if (
				$type === Model::COLUMN_TYPE_TIMESTAMP
				|| $type === Model::COLUMN_TYPE_INTEGER_TIMESTAMP
			) {
				if (!$value) {
					$array[$column_name] = null;
					continue;
				}
				if (!is_int($value)) {
					$value = strtotime($value);
				}
				if (!is_int($value)) {
					throw new RuntimeException('Error parsing date "' . $array[$column_name] . '"');
				}
				$value = date('c', $value);
			}
		}
		return $array;
	}
404836
@Override
	protected void serializeTo(RawDataBuffer out)
    {
    	super.serializeTo(out);
    	if (deliveredMessageIDs != null)
        {
    		int len = deliveredMessageIDs.size(); 
            out.writeInt(len);
            for (int i = 0; i < len; i++)
            	out.writeUTF(deliveredMessageIDs.get(i));
        }
        else
            out.writeInt(0);
    }
890469
public function serialize()
	{
		// Load all of the inputs.
		$this->loadAllInputs();

		// Remove $_ENV and $_SERVER from the inputs.
		$inputs = $this->inputs;
		unset($inputs['env'], $inputs['server']);

		// Serialize the options, data, and inputs.
		return serialize(array($this->options, $this->data, $inputs));
	}
334950
public function jsonSerialize()
    {
        $data = [
            '@context' => [],
            '@id' => $this->uri,
        ];
        $types = $this->types;
        if (!empty($types)) {
            $data['@type'] = $this->transfromArray($types);
        }

        if (!$this->triples instanceof \core_kernel_classes_ContainerCollection) {
            return $data;
        }

        $triples = $this->triples->toArray();
        $map = [];
        foreach ($triples as $key => $triple) {
            if (in_array($triple->predicate, $this->blackList)) {
                continue;
            }

            if (!isset($map[$triple->predicate])) {
                $id = $this->generateId($triple->predicate);
                if (in_array($id, $map)) {
                    $nr = 0;
                    while (in_array($id . '_' . $nr, $map)) {
                        $nr++;
                    }
                    $id = $id . '_' . $nr;
                }
                $map[$triple->predicate] = $id;
                $data['@context'][$id] = $triple->predicate;
            }

            $key = $map[$triple->predicate];
            if (isset($data[$key])) {
                if (!is_array($data[$key])) {
                    $data[$key] = array($data[$key]);
                }
                $data[$key][] = $this->encodeValue($triple->object, $triple->predicate);
            } else {
                $data[$key] = $this->encodeValue($triple->object, $triple->predicate);
            }
        }

        // Enforce serialization to object if context is empty
        $data['@context'] = (object) $data['@context'];

        return $data;
    }
360832
function serialize(obj) {
  var params = [],
    encodedBrackets = encodeURIComponent('[]');

  _.forOwn(obj, function(value, key) {
    if (typeof value === 'string' ||
      typeof value === 'number' ||
      typeof value === 'boolean') {
      params.push(key + '=' + encodeURIComponent(value));
    } else if (typeof value === 'object' && Array.isArray(value)) {
      params.push(value.map(function(param) {
        return key + encodedBrackets + '=' + encodeURIComponent(param);
      }).join('&'));
    }
  });

  return params.join('&');
}
1221498
@SuppressWarnings("unchecked")
	@Override
	public <E> void serialize(E object, Writer output) {
		if (object == null)
			return;

		try (SerializerWrapper serializer = createSerializer(output)) {
			mapperFor((Class<E>) object.getClass()).serialize(this, serializer, object);
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
403075
function serialize( arr ) {
	var len = arr.length,
		n = len - 1,
		str,
		i;

	str = '[';
	for ( i = 0; i < len; i++ ) {
		str += arr[ i ];
		if ( i < n ) {
			str += ',';
		}
	}
	str += ']';

	return 'new '+arr.constructor.name+'('+str+')';
}
406808
@SuppressWarnings("null")
  @Override
  public byte[] toByteArray() {
    byte[][] summariesBytes = null;
    int summariesBytesLength = 0;
    if (count_ > 0) {
      summariesBytes = new byte[count_][];
      int i = 0;
      for (int j = 0; j < summaries_.length; j++) {
        if (summaries_[j] != null) {
          summariesBytes[i] = summaries_[j].toByteArray();
          summariesBytesLength += summariesBytes[i].length;
          i++;
        }
      }
    }
    int sizeBytes =
        Byte.BYTES // preamble longs
      + Byte.BYTES // serial version
      + Byte.BYTES // family
      + Byte.BYTES // sketch type
      + Byte.BYTES // flags
      + Byte.BYTES // log2(nomEntries)
      + Byte.BYTES // log2(currentCapacity)
      + Byte.BYTES; // log2(resizeFactor)
    if (isInSamplingMode()) {
      sizeBytes += Float.BYTES; // samplingProbability
    }
    final boolean isThetaIncluded = isInSamplingMode()
        ? theta_ < samplingProbability_ : theta_ < Long.MAX_VALUE;
    if (isThetaIncluded) {
      sizeBytes += Long.BYTES;
    }
    if (count_ > 0) {
      sizeBytes += Integer.BYTES; // count
    }
    sizeBytes += (Long.BYTES * count_) + summariesBytesLength;
    final byte[] bytes = new byte[sizeBytes];
    int offset = 0;
    bytes[offset++] = PREAMBLE_LONGS;
    bytes[offset++] = serialVersionUID;
    bytes[offset++] = (byte) Family.TUPLE.getID();
    bytes[offset++] = (byte) SerializerDeserializer.SketchType.QuickSelectSketch.ordinal();
    final boolean isBigEndian = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN);
    bytes[offset++] = (byte) (
      (isBigEndian ? 1 << Flags.IS_BIG_ENDIAN.ordinal() : 0)
      | (isInSamplingMode() ? 1 << Flags.IS_IN_SAMPLING_MODE.ordinal() : 0)
      | (isEmpty_ ? 1 << Flags.IS_EMPTY.ordinal() : 0)
      | (count_ > 0 ? 1 << Flags.HAS_ENTRIES.ordinal() : 0)
      | (isThetaIncluded ? 1 << Flags.IS_THETA_INCLUDED.ordinal() : 0)
    );
    bytes[offset++] = (byte) Integer.numberOfTrailingZeros(nomEntries_);
    bytes[offset++] = (byte) lgCurrentCapacity_;
    bytes[offset++] = (byte) lgResizeFactor_;
    if (samplingProbability_ < 1f) {
      ByteArrayUtil.putFloatLE(bytes, offset, samplingProbability_);
      offset += Float.BYTES;
    }
    if (isThetaIncluded) {
      ByteArrayUtil.putLongLE(bytes, offset, theta_);
      offset += Long.BYTES;
    }
    if (count_ > 0) {
      ByteArrayUtil.putIntLE(bytes, offset, count_);
      offset += Integer.BYTES;
    }
    if (count_ > 0) {
      int i = 0;
      for (int j = 0; j < keys_.length; j++) {
        if (summaries_[j] != null) {
          ByteArrayUtil.putLongLE(bytes, offset, keys_[j]);
          offset += Long.BYTES;
          System.arraycopy(summariesBytes[i], 0, bytes, offset, summariesBytes[i].length);
          offset += summariesBytes[i].length;
          i++;
        }
      }
    }
    return bytes;
  }
735772
@Override
    protected byte[] serialize(Object o) {
        ClassLoaderRegisteringObjectInputStream.register(o.getClass());
        return super.serialize(o);
    }
614274
function serializeCurrentNode(currentNode) {
  var children = currentNode.children;
  if (!children) {
    return null;
  }
  var len = children.length;
  var arr = new Array(len);
  var i = -1;
  while (++i < len) {
    arr[i] = serializeCurrentNode(children[i]);
  }
  if (currentNode.count) {
    return [arr, currentNode.count];
  } else {
    return [arr];
  }
}
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);
    }