當前位置: 首頁>>代碼示例>>Java>>正文


Java Output.writeInt方法代碼示例

本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeInt方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeInt方法的具體用法?Java Output.writeInt怎麽用?Java Output.writeInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.esotericsoftware.kryo.io.Output的用法示例。


在下文中一共展示了Output.writeInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public byte[] apply(Object value) {
    try {
        Kryo kryo = kryoThreadLocal.get();
        ByteArrayOutputStream bos = new ByteArrayOutputStream(256);
        Output output = new Output(bos);
        output.writeInt(IDENTITY_NUMBER);
        kryo.writeClassAndObject(output, value);
        output.close();
        return bos.toByteArray();
    } catch (Exception e) {
        StringBuilder sb = new StringBuilder("Kryo Encode error. ");
        sb.append("msg=").append(e.getMessage());
        throw new CacheEncodeException(sb.toString(), e);
    }
}
 
開發者ID:alibaba,項目名稱:jetcache,代碼行數:17,代碼來源:KryoValueEncoder.java

示例2: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(final Kryo kryo, final Output output, final ImmutableSet<Object> object) {
  output.writeInt(object.size(), true);
  final UnmodifiableIterator iterator = object.iterator();

  while (iterator.hasNext()) {
    final Object value = iterator.next();
    kryo.writeClassAndObject(output, value);
  }
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:11,代碼來源:ImmutableCollectionSerializers.java

示例3: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Summary object) {
    output.writeInt(object.value.length);
    for (int i = 0; i < object.value.length; i++) {
        output.writeFloat(object.value[i]);
    }

    output.writeInt(object.rmin.length);
    for (int i = 0; i < object.rmin.length; i++) {
        output.writeDouble(object.rmin[i]);
    }

    output.writeInt(object.rmax.length);
    for (int i = 0; i < object.rmax.length; i++) {
        output.writeDouble(object.rmax[i]);
    }

    output.writeInt(object.w.length);
    for (int i = 0; i < object.w.length; i++) {
        output.writeFloat(object.w[i]);
    }

    output.writeInt(object.capacity);
    output.writeInt(object.cursor);
    output.writeDouble(object.B);
    output.writeBoolean(object.exact);
    output.writeDouble(object.eps);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:29,代碼來源:WeightApproximateQuantile.java

示例4: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, FloatCounter floatCounter) {
    kryo.writeObjectOrNull(output, floatCounter.mean, WindowedMean.class);
    output.writeInt(floatCounter.count);
    output.writeFloat(floatCounter.total);
    output.writeFloat(floatCounter.min);
    output.writeFloat(floatCounter.max);
    output.writeFloat(floatCounter.average);
    output.writeFloat(floatCounter.latest);
    output.writeFloat(floatCounter.value);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:12,代碼來源:FloatCounterSerializer.java

示例5: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Color color) {
    Boolean compact = GraphHeader.isUseCompactColor(kryo);
    if (compact == null) compact = isCompactDefault;
    if (compact){
        output.writeInt(Color.rgba8888(color));
    } else {
        output.writeFloat(color.r);
        output.writeFloat(color.g);
        output.writeFloat(color.b);
        output.writeFloat(color.a);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:14,代碼來源:ColorSerializer.java

示例6: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Set<T> object) {
    output.writeInt(object.size());
    for (T val : object) {
        valSerializer.write(kryo, output, val);
    }
}
 
開發者ID:yuantiku,項目名稱:ytk-mp4j,代碼行數:8,代碼來源:ProcessCommSlave.java

示例7: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, IntIntMap map) {
    int length = map.size;
    output.writeVarInt(length, true);

    for (Iterator iter = map.iterator(); iter.hasNext();) {
        IntIntMap.Entry entry = (IntIntMap.Entry)iter.next();
        output.writeInt(entry.key);
        output.writeInt(entry.value);
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:11,代碼來源:IntIntMapSerializer.java

示例8: send

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void send(Output output) throws IOException {
    output.writeInt(srcRank);
    output.writeInt(destRank);
    output.writeInt(step);
    output.writeInt(sum);
    output.writeInt(segNum);
    for (int i = 0; i < segNum; i++) {
        output.writeInt(ranks.get(i));
        output.writeInt(segFroms.get(i));
        output.writeInt(segTos.get(i));
    }
    output.flush();
}
 
開發者ID:yuantiku,項目名稱:ytk-mp4j,代碼行數:15,代碼來源:ArrayMetaData.java

示例9: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, IntArray array) {
    output.writeVarInt(array.size, true);
    output.writeBoolean(array.ordered);
    for (int i = 0; i < array.size; i++) {
        output.writeInt(array.get(i));
    }
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:9,代碼來源:IntArraySerializer.java

示例10: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, T bitSource) {
    int numBits = numBits(bitSource);
    output.writeInt(numBits, true);
    long[] array = new long[(numBits >>> 6) + 1];
    for (int i = 0; i < numBits; i++) {
        if (get(bitSource, i)) {
            final int word = i >>> 6;
            array[word] |= 1L << (i & 0x3F);
        }
    }
    output.writeLongs(array);
}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:14,代碼來源:AbstractBooleanArraySerializer.java

示例11: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, List<?> object) {
    output.writeInt(object.size(), true);
    for (Object elm : object) {
        kryo.writeClassAndObject(output, elm);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:ArraysAsListSerializer.java

示例12: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output,
        Ip6Prefix object) {
    byte[] octs = object.address().toOctets();
    // It is always Ip6Address.BYTE_LENGTH
    output.writeInt(octs.length);
    output.writeBytes(octs);
    output.writeInt(object.prefixLength());
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:10,代碼來源:Ip6PrefixSerializer.java

示例13: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, SplitInfo object) {
    output.writeFloat(object.lossChg);
    output.writeInt(object.splitIndex);
    output.writeFloat(object.splitValue);
    output.writeInt(object.splitSlotInterval.length);
    for (int i = 0; i < object.splitSlotInterval.length; i++) {
        output.writeInt(object.splitSlotInterval[i]);
    }
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:11,代碼來源:SplitInfo.java

示例14: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Ip4Address object) {
    byte[] octs = object.toOctets();
    // It is always Ip4Address.BYTE_LENGTH
    output.writeInt(octs.length);
    output.writeBytes(octs);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:8,代碼來源:Ip4AddressSerializer.java

示例15: write

import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output out) {
  byte[] bytes = getBytes();
  out.writeInt(bytes.length);
  out.write(bytes);
}
 
開發者ID:huang-up,項目名稱:mycat-src-1.6.1-RELEASE,代碼行數:7,代碼來源:UTF8String.java


注:本文中的com.esotericsoftware.kryo.io.Output.writeInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。