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


Java ObjectDataInput.readFully方法代码示例

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


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

示例1: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public KryoMarker read(ObjectDataInput in)
        throws IOException {

    String className = in.readUTF();
    int dataLength = in.readInt();
    byte[] data = new byte[dataLength];
    in.readFully(data);

    try (Input input = new UnsafeInput(data)) {
        Class<? extends KryoMarker> clazz = (Class<? extends KryoMarker>) Class.forName(className);
        return getKryo().readObject(input, clazz);

    } catch (ClassNotFoundException e) {
        throw new IOException(e);
    }
}
 
开发者ID:noctarius,项目名称:hazelcast-unaware-serialization,代码行数:18,代码来源:KryoAvailableSerializer.java

示例2: readInternal

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    int mapSize = in.readInt();
    migrationData = new HashMap<String, byte[]>(mapSize);
    for (int i = 0; i < mapSize; i++) {
        String name = in.readUTF();
        int number = in.readInt();
        byte[] a = new byte[number];
        in.readFully(a);
        migrationData.put(name, a);
    }
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:13,代码来源:HyperLogLogReplicationOperation.java

示例3: readInternal

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    super.readInternal(in);
    int size = in.readInt();
    byte[] rawHll = new byte[size];
    in.readFully(rawHll);
    hll = new HLLWrapper(rawHll);
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:9,代码来源:UnionOperation.java

示例4: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void read(PortableReader reader) throws IOException {
    super.read(reader);
    ObjectDataInput in = reader.getRawDataInput();
    int size = in.readInt();
    byte[] rawHll = new byte[size];
    in.readFully(rawHll);
    hll = new HLLWrapper(rawHll);
}
 
开发者ID:buremba,项目名称:hazelcast-modules,代码行数:10,代码来源:UnionRequest.java

示例5: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public KryoMarker read(ObjectDataInput in)
        throws IOException {

    String className = in.readUTF();
    int dataLength = in.readInt();
    byte[] data = new byte[dataLength];
    in.readFully(data);

    return new KryoEnvelope(className, data);
}
 
开发者ID:noctarius,项目名称:hazelcast-unaware-serialization,代码行数:12,代码来源:KryoUnavailableSerializer.java

示例6: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput objectDataInput) throws IOException {
  String className = objectDataInput.readUTF();
  int length = objectDataInput.readInt();
  byte[] bytes = new byte[length];
  objectDataInput.readFully(bytes);
  try {
    Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
    clusterSerializable = (ClusterSerializable) clazz.newInstance();
    clusterSerializable.readFromBuffer(0, Buffer.buffer(bytes));
  } catch (Exception e) {
    throw new IllegalStateException("Failed to load class " + e.getMessage(), e);
  }
}
 
开发者ID:vert-x3,项目名称:vertx-hazelcast,代码行数:15,代码来源:ConversionUtils.java

示例7: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(final ObjectDataInput in) throws IOException {
    version = in.readLong();
    final int valueLen = in.readInt();
    value = new byte[valueLen];
    in.readFully(value);
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:8,代码来源:HZTable.java


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