Java Code Examples for org.apache.ignite.binary.BinaryWriter#writeChar()

The following examples show how to use org.apache.ignite.binary.BinaryWriter#writeChar() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IgniteComputeConfigVariationsFullApiTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @param writer Writer.
 * @param isVal boolean value.
 * @param bVal byte value.
 * @param cVal char value.
 * @param sVal short value.
 * @param intVal int value.
 * @param lVal long value.
 * @param fltVal float value.
 * @param dblVal double value.
 * @param strVal String value.
 * @param arrVal Array value.
 * @param eVal Enum value.
 * @throws BinaryObjectException If failed.
 */
private static void writeJobState(BinaryWriter writer, boolean isVal, byte bVal, char cVal, short sVal,
    int intVal, long lVal, float fltVal, double dblVal, String strVal,
    Object[] arrVal, TestJobEnum eVal) throws BinaryObjectException {
    writer.writeBoolean("isVal", isVal);
    writer.writeByte("bVal", bVal);
    writer.writeChar("cVal", cVal);
    writer.writeShort("sVal", sVal);
    writer.writeInt("intVal", intVal);
    writer.writeLong("lVal", lVal);
    writer.writeFloat("fltVal", fltVal);
    writer.writeDouble("dblVal", dblVal);
    writer.writeString("strVal", strVal);
    writer.writeObjectArray("arrVal", arrVal);
    writer.writeEnum("eVal", eVal);
}
 
Example 2
Source File: GridDefaultBinaryMappersBinaryMetaDataSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    writer.writeBoolean("boolVal", false);
    writer.writeDate("dateVal", new Date());
    writer.writeUuidArray("uuidArrVal", null);
    writer.writeObject("objVal", null);
    writer.writeMap("mapVal", new HashMap<>());
    writer.writeDecimal("decVal", BigDecimal.ZERO);
    writer.writeDecimalArray("decArrVal", new BigDecimal[] { BigDecimal.ONE });

    if (idx == 1) {
        writer.writeChar("charVal", (char)0);
        writer.writeCollection("colVal", null);
    }

    BinaryRawWriter raw = writer.rawWriter();

    raw.writeChar((char)0);
    raw.writeCollection(null);
}
 
Example 3
Source File: BinaryMarshallerSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
    writer.writeByte("_b", b);
    writer.writeShort("_s", s);
    writer.writeInt("_i", i);
    writer.writeLong("_l", l);
    writer.writeFloat("_f", f);
    writer.writeDouble("_d", d);
    writer.writeChar("_c", c);
    writer.writeBoolean("_bool", bool);
    writer.writeString("_str", str);
    writer.writeUuid("_uuid", uuid);
    writer.writeDate("_date", date);
    writer.writeTimestamp("_ts", ts);
    writer.writeTime("_time", time);
    writer.writeByteArray("_bArr", bArr);
    writer.writeShortArray("_sArr", sArr);
    writer.writeIntArray("_iArr", iArr);
    writer.writeLongArray("_lArr", lArr);
    writer.writeFloatArray("_fArr", fArr);
    writer.writeDoubleArray("_dArr", dArr);
    writer.writeCharArray("_cArr", cArr);
    writer.writeBooleanArray("_boolArr", boolArr);
    writer.writeStringArray("_strArr", strArr);
    writer.writeUuidArray("_uuidArr", uuidArr);
    writer.writeDateArray("_dateArr", dateArr);
    writer.writeTimeArray("_timeArr", timeArr);
    writer.writeObjectArray("_objArr", objArr);
    writer.writeCollection("_col", col);
    writer.writeMap("_map", map);
    writer.writeEnum("_enumVal", enumVal);
    writer.writeEnumArray("_enumArr", enumArr);
    writer.writeObject("_simple", simple);
    writer.writeObject("_binary", binary);

    BinaryRawWriter raw = writer.rawWriter();

    raw.writeByte(bRaw);
    raw.writeShort(sRaw);
    raw.writeInt(iRaw);
    raw.writeLong(lRaw);
    raw.writeFloat(fRaw);
    raw.writeDouble(dRaw);
    raw.writeChar(cRaw);
    raw.writeBoolean(boolRaw);
    raw.writeString(strRaw);
    raw.writeUuid(uuidRaw);
    raw.writeDate(dateRaw);
    raw.writeTimestamp(tsRaw);
    raw.writeTime(timeRaw);
    raw.writeByteArray(bArrRaw);
    raw.writeShortArray(sArrRaw);
    raw.writeIntArray(iArrRaw);
    raw.writeLongArray(lArrRaw);
    raw.writeFloatArray(fArrRaw);
    raw.writeDoubleArray(dArrRaw);
    raw.writeCharArray(cArrRaw);
    raw.writeBooleanArray(boolArrRaw);
    raw.writeStringArray(strArrRaw);
    raw.writeUuidArray(uuidArrRaw);
    raw.writeDateArray(dateArrRaw);
    raw.writeTimeArray(timeArrRaw);
    raw.writeObjectArray(objArrRaw);
    raw.writeCollection(colRaw);
    raw.writeMap(mapRaw);
    raw.writeEnum(enumValRaw);
    raw.writeEnumArray(enumArrRaw);
    raw.writeObject(simpleRaw);
    raw.writeObject(binaryRaw);
}