本文整理匯總了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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));
}
}
示例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);
}
示例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);
}
}
示例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());
}
示例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]);
}
}
示例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);
}
示例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);
}