当前位置: 首页>>代码示例>>Java>>正文


Java ObjectDataOutput.write方法代码示例

本文整理汇总了Java中com.hazelcast.nio.ObjectDataOutput.write方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataOutput.write方法的具体用法?Java ObjectDataOutput.write怎么用?Java ObjectDataOutput.write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.hazelcast.nio.ObjectDataOutput的用法示例。


在下文中一共展示了ObjectDataOutput.write方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, KryoMarker object)
        throws IOException {

    if (object instanceof KryoEnvelope) {
        KryoEnvelope envelope = (KryoEnvelope) object;
        out.writeUTF(envelope.getClassName());

        byte[] data = envelope.getData();
        out.writeInt(data.length);
        out.write(data);

    } else {
        throw new IllegalStateException("KryoMarker value cannot be serialized since kryo isn't available");
    }
}
 
开发者ID:noctarius,项目名称:hazelcast-unaware-serialization,代码行数:17,代码来源:KryoUnavailableSerializer.java

示例2: writeBytes

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
private static void writeBytes(ObjectDataOutput out, byte[] bytes) throws IOException {
    if (bytes.length > MAX_BIGINT_LEN) {
        throw new JetException(
                "BigInteger serialized to " + bytes.length + " bytes, only up to 255 is supported");
    }
    out.write(bytes.length);
    out.write(bytes);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:9,代码来源:LinTrendAccumulator.java

示例3: writeInternal

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    out.writeInt(migrationData.size());
    for (Map.Entry<String, byte[]> entry : migrationData.entrySet()) {
        out.writeUTF(entry.getKey());
        byte[] val = entry.getValue();
        out.writeInt(val.length);
        out.write(val);
    }
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:11,代码来源:HyperLogLogReplicationOperation.java

示例4: writeInternal

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
protected void writeInternal(ObjectDataOutput out) throws IOException {
    super.writeInternal(out);
    byte[] bytes = hll.bytes();
    out.writeInt(bytes.length);
    out.write(bytes);
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:8,代码来源:UnionOperation.java

示例5: write

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(PortableWriter writer) throws IOException {
    super.write(writer);
    ObjectDataOutput out = writer.getRawDataOutput();
    byte[] bytes = hll.bytes();
    out.writeInt(bytes.length);
    out.write(bytes);
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:9,代码来源:UnionRequest.java

示例6: write

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, KryoMarker object)
        throws IOException {

    String className;
    byte[] data;

    if (object instanceof KryoEnvelope) {
        KryoEnvelope envelope = (KryoEnvelope) object;
        className = envelope.getClassName();
        data = envelope.getData();

    } else {
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); //
             Output output = new UnsafeOutput(baos);) {

            className = object.getClass().getName();
            getKryo().writeObject(output, object);
            output.flush();
            data = baos.toByteArray();
        }
    }

    out.writeUTF(className);
    out.writeInt(data.length);
    out.write(data);
}
 
开发者ID:noctarius,项目名称:hazelcast-unaware-serialization,代码行数:28,代码来源:KryoAvailableSerializer.java

示例7: writeData

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput objectDataOutput) throws IOException {
  objectDataOutput.writeUTF(clusterSerializable.getClass().getName());
  Buffer buffer = Buffer.buffer();
  clusterSerializable.writeToBuffer(buffer);
  byte[] bytes = buffer.getBytes();
  objectDataOutput.writeInt(bytes.length);
  objectDataOutput.write(bytes);
}
 
开发者ID:vert-x3,项目名称:vertx-hazelcast,代码行数:10,代码来源:ConversionUtils.java

示例8: writeData

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(final ObjectDataOutput out) throws IOException {
    out.writeLong(version);
    out.writeInt(value.length);
    if (value.length > 0) {
        out.write(value);
    }
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:9,代码来源:HZTable.java

示例9: writeData

import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
	out.writeUTF(userName);
	out.write(password);
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:6,代码来源:UserAuthenticator.java


注:本文中的com.hazelcast.nio.ObjectDataOutput.write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。