Serializing to given dataput

@throws TTIOException
348339
public void serialize(final DataOutput output) throws TTIOException {
        try {
            output.writeLong(dataKey);
            output.writeBoolean(eof);
            output.writeInt(val.length);
            output.write(val);
        } catch (final IOException exc) {
            throw new TTIOException(exc);
        }
    }
352918
def serialize(self, data):
        

        super(Serializer, self).serialize(data)

        self.resp.content_type += '; header=present'
        import pprint
        pprint.PrettyPrinter().pprint(data)
144759
public static void serialize(Output out, Object any) {
        Serializer.serialize(out, null, null, null, any);
    }
697424
@Override
  public void serialize(DataOutput out) throws IOException {
    int startOffset = 0;
    boolean hasrun = hasRunCompression();
    if (hasrun) {
      out.writeInt(Integer.reverseBytes(SERIAL_COOKIE | ((this.size - 1) << 16)));
      byte[] bitmapOfRunContainers = new byte[(size + 7) / 8];
      for (int i = 0; i < size; ++i) {
        if (this.values[i] instanceof MappeableRunContainer) {
          bitmapOfRunContainers[i / 8] |= (1 << (i % 8));
        }
      }
      out.write(bitmapOfRunContainers);
      if (this.size < NO_OFFSET_THRESHOLD) {
        startOffset = 4 + 4 * this.size + bitmapOfRunContainers.length;
      } else {
        startOffset = 4 + 8 * this.size + bitmapOfRunContainers.length;
      }
    } else { // backwards compatibilility
      out.writeInt(Integer.reverseBytes(SERIAL_COOKIE_NO_RUNCONTAINER));
      out.writeInt(Integer.reverseBytes(size));
      startOffset = 4 + 4 + this.size * 4 + this.size * 4;
    }
    for (int k = 0; k < size; ++k) {
      out.writeShort(Short.reverseBytes(this.keys[k]));
      out.writeShort(Short.reverseBytes((short) (this.values[k].getCardinality() - 1)));
    }
    if ((!hasrun) || (this.size >= NO_OFFSET_THRESHOLD)) {
      for (int k = 0; k < this.size; k++) {
        out.writeInt(Integer.reverseBytes(startOffset));
        startOffset = startOffset + values[k].getArraySizeInBytes();
      }
    }
    for (int k = 0; k < size; ++k) {
      values[k].writeArray(out);
    }

  }
296409
public void serialize(T object, OutputStream os) throws IOException {
        JsonGenerator jsonGenerator = LoganSquare.JSON_FACTORY.createGenerator(os);
        serialize(object, jsonGenerator, true);
        jsonGenerator.close();
    }
132187
public void write(DataOutput out) throws IOException {
    taskId.write(out); 
    WritableUtils.writeVInt(out, idWithinJob);
    out.writeBoolean(isMap);
    WritableUtils.writeEnum(out, status); 
    WritableUtils.writeString(out, taskTrackerHttp);
    WritableUtils.writeVInt(out, taskRunTime);
    WritableUtils.writeVInt(out, eventId);
  }
1220128
protected void serializeObject(final DataOutputStream dos, final Object value) throws IOException {

		if (value != null) {

			final Integer typeKey = TypeMap.get(value.getClass());
			if (typeKey != null) {

				dos.writeInt(typeKey);

				switch (typeKey) {

					case 1:
						dos.writeUTF((String)value);
						break;

					case 2:
						dos.writeInt((Integer)value);
						break;

					case 3:
						dos.writeLong((Long)value);
						break;

					case 4:
						dos.writeBoolean((Boolean)value);
						break;

					case 5:
						dos.writeDouble((Double)value);
						break;

					case 6:
						dos.writeFloat((Float)value);
						break;

					case 100:
						serializeList(dos, (List<Object>)value);
						break;

				}

			} else {

				System.out.println("Unknown type " + value.getClass() + ", cannot serialize!");
			}

		} else {

			dos.writeInt(0);
		}
	}
1035613
public function serializeData()
    {
        if (isset($this->_dataObject)) {
            try {
                $this->result = serialize($this->_dataObject);
            } catch (\Exception $e) {
                \d($this->_dataObject);
                exit;
            }
        }
    }
417568
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, values.length);
    WritableUtils.writeVLong(out, written);
    for (int i = 0; i < values.length; ++i) {
      Text.writeString(out, values[i].getClass().getName());
    }
    for (int i = 0; i < values.length; ++i) {
      if (has(i)) {
        values[i].write(out);
      }
    }
  }
815918
public void serialize(final DataOutput pOutput) throws TTIOException {
        try {
            pOutput.writeLong(getFirstChildKey());
            pOutput.writeLong(getRightSiblingKey());
            pOutput.writeLong(getLeftSiblingKey());
            pOutput.writeLong(getChildCount());
        } catch (final IOException exc) {
            throw new TTIOException(exc);
        }
    }
354376
void writeTo(DataOutputStream out) throws IOException {

    // We do the UTF8 conversion ourselves instead of relying on DataOutput
    // to ensure we strictly follow UTF-8 standard, as well as better performance,
    // and save the code to count the UTF-8 bytes (we need that to calculate
    // the total length.
    int length = size() - 4;

    out.writeInt(length);
    out.writeShort(codecNameUTF8.length);
    out.write(codecNameUTF8);
    if (codecNameUTF8.length == 0) {
      out.writeLong(crc32Value);
    }
    out.write(storedData.getData(), 0, storedData.getLength());
  }
644701
public OutputStream serialize(final OutputStream pToSerialize) throws TTByteHandleException {
        try {
            final Cipher cipher = Cipher.getInstance(ALGORITHM);
            cipher.init(Cipher.ENCRYPT_MODE, mKey);
            return new CipherOutputStream(pToSerialize, cipher);
        } catch (final InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException exc) {
            throw new TTByteHandleException(exc);
        }
    }
411469
@SuppressWarnings("unchecked")
  private BufferOutput writeById(int id, Object object, BufferOutput output, TypeSerializer serializer) {
    for (Identifier identifier : Identifier.values()) {
      if (identifier.accept(id)) {
        identifier.write(id, output.writeByte(identifier.code()));
        serializer.write(object, output, this);
        return output;
      }
    }
    throw new SerializationException("invalid type ID: " + id);
  }
566503
@Override
	protected void serializeTo(RawDataBuffer out)
    {
    	super.serializeTo(out);
        out.writeInt(consumerId.asInt());
    }
1318865
void write(Object value) throws IOException {
    if (clientInputSerializer != null) {
      clientInputSerializer.serialize(value);
      return;
    }

    byte[] bval;
    int valSize;
    if (value instanceof BytesWritable) {
      BytesWritable val = (BytesWritable) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else if (value instanceof Text) {
      Text val = (Text) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else {
      String sval = value.toString();
      bval = sval.getBytes("UTF-8");
      valSize = bval.length;
    }
    clientOut_.write(bval, 0, valSize);
  }
796121
static void deserialize(DataInput in, Serializers serializers)
      throws IOException, ClassNotFoundException {
    int size = in.readInt();
    if (size > 0) {
      StringBuilder msg = new StringBuilder(String.format("Deserialize %d serializer classes:", size));

      if (serializers.serializersArray.length < size) {
        serializers.serializersArray = Arrays.copyOf(serializers.serializersArray, size);
      }

      int max = 0;
      for (int i = 0; i < size; i++) {
        int index = in.readInt();
        max = Math.max(max, index);
        String serializerClassName = in.readUTF();
        try {
          Class<Serializer> serializerClass = (Class<Serializer>) Class.forName(serializerClassName);
          Serializer serializerInstance = serializerClass.newInstance();
          serializers.serializers
              .put(getSerializerType(serializerInstance), new SerializerWrapper(index, serializerInstance));
          serializers.serializersArray[index] = serializerInstance;

          msg.append(String.format("%n  (%d) %s", index, serializerClassName));
        } catch (Exception ex) {
          LOGGER.log(Level.WARNING, (String.format("Can't find the serializer '%s'", serializerClassName)), ex);
        }
      }
      serializers.COUNTER.set(max + 1);

      LOGGER.info(msg.toString());
    }
  }
602494
public void write(DataOutput out) throws IOException {
    UTF8.writeString(out, file);
    out.writeLong(start);
    out.writeLong(length);
  }