本文整理汇总了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");
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例9: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(userName);
out.write(password);
}