本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}