本文整理汇总了Java中com.hazelcast.nio.ObjectDataInput.readUTF方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataInput.readUTF方法的具体用法?Java ObjectDataInput.readUTF怎么用?Java ObjectDataInput.readUTF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.nio.ObjectDataInput
的用法示例。
在下文中一共展示了ObjectDataInput.readUTF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheEntry read(ObjectDataInput in)
throws IOException {
try {
int length = in.readInt();
Serializable[] disassembledState = new Serializable[length];
for (int i = 0; i < length; i++) {
disassembledState[i] = in.readObject();
}
String subclass = in.readUTF();
boolean lazyPropertiesAreUnfetched = in.readBoolean();
Object version = in.readObject();
return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, lazyPropertiesAreUnfetched, version);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例2: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public MutableRepositoryItemExt read(ObjectDataInput in) throws IOException {
try {
String gsonString = in.readUTF();
System.out.println("MutableRepositoryItemExtHazelcastSerializer deserialize " + System.currentTimeMillis() + " " + gsonString);
Gson gson = new GsonBuilder().enableComplexMapKeySerialization().create();
Map<String, Object> cache = gson.fromJson(gsonString, Map.class);
String javaClassName = (String) cache.get("__class");
String repositoryId = (String) cache.get("__repositoryId");
Class beanClass = Class.forName(javaClassName);
MutableRepositoryItemExt mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(beanClass, null);
mutableRepositoryItemExt.setRepositoryId(repositoryId);
mutableRepositoryItemExt.setCachedData(cache);
return mutableRepositoryItemExt;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例3: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
clientId = in.readUTF();
ip = in.readUTF();
port = in.readInt();
isConnected = in.readBoolean();
currentMessageId = in.readInt();
if (in.readBoolean()) {
will = new Message(in);
}
cleanSession = in.readBoolean();
keepAliveSeconds = in.readInt();
long rawLong = in.readLong();
createTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;
rawLong = in.readLong();
lastIncomingTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;
disposeLock = ClusterDataFactory.INSTANCE.createLock("Session_disposeLock_" + clientId);
messageSender = new MessageSender(this);
}
示例4: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
try
{
//setIterationError(in.readDouble());
//setMeanAbsErr(in.readDouble());
//setRootMeanSqErr(in.readDouble());
//setPctIncorrect(in.readDouble());
//setFolds(in.readInt());
setName(in.readUTF());
classifierImpl = in.readUTF();
deserializeClassifierFromJson(in.readUTF());
setLongId(in.readLong());
setStringId(in.readUTF());
setGeneratedOn(in.readLong());
} catch (Exception e) {
throw new IOException(e);
}
}
示例5: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheKey read(ObjectDataInput in)
throws IOException {
try {
Object key = in.readObject();
Type type = in.readObject();
String entityOrRoleName = in.readUTF();
String tenantId = in.readUTF();
int hashCode = in.readInt();
CacheKey cacheKey = (CacheKey) UNSAFE.allocateInstance(CacheKey.class);
UNSAFE.putObjectVolatile(cacheKey, KEY_OFFSET, key);
UNSAFE.putObjectVolatile(cacheKey, TYPE_OFFSET, type);
UNSAFE.putObjectVolatile(cacheKey, ENTITY_OR_ROLE_NAME_OFFSET, entityOrRoleName);
UNSAFE.putObjectVolatile(cacheKey, TENANT_ID_OFFSET, tenantId);
UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode);
return cacheKey;
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例6: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Writable read(ObjectDataInput in) throws IOException {
if (!warnedOnce) {
LOGGER.warning("Using default Writable serialization without explicit type registration. " +
"Consider explicit type registration using WritableSerializerHook.");
warnedOnce = true;
}
String className = in.readUTF();
try {
Writable instance = ClassLoaderUtil.newInstance(Thread.currentThread().getContextClassLoader(), className);
instance.readFields(in);
return instance;
} catch (Exception e) {
throw rethrow(e);
}
}
示例7: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Role read(ObjectDataInput in) throws IOException {
Object[] entity = super.readEntity(in);
String name = in.readUTF();
String description = in.readUTF();
List<Permission> perms = (List<Permission>) in.readObject();
Set<String> roles = (Set<String>) in.readObject();
Map<String, Permission> mPerms = new HashMap<String, Permission>(perms.size());
for (Permission xpm: perms) {
mPerms.put(xpm.getResource(), xpm);
}
Role xRole = new Role(
(int) entity[0],
(Date) entity[1],
(String) entity[2],
mPerms,
roles,
name,
description);
return xRole;
}
示例8: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Document read(ObjectDataInput in) throws IOException {
FragmentedDocument xDoc = new FragmentedDocument(
in.readLong(),
in.readUTF(),
in.readUTF(),
in.readLong(),
in.readLong(),
new java.util.Date(in.readLong()),
in.readUTF(),
in.readUTF(),
in.readInt(),
in.readInt());
xDoc.setCollections(in.readIntArray());
xDoc.setFragments(in.readLongArray());
return xDoc;
}
示例9: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
id = in.readUTF();
bookId = in.readUTF();
cost = in.readDouble();
quantity = in.readInt();
inStock = in.readBoolean();
}
示例10: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
this.clientId = in.readUTF();
this.clientSecret = in.readUTF();
this.clientType = Client.ClientTypeEnum.fromValue(in.readUTF());
this.clientProfile = Client.ClientProfileEnum.fromValue(in.readUTF());
this.clientName = in.readUTF();
this.clientDesc = in.readUTF();
this.ownerId = in.readUTF();
this.scope = in.readUTF();
this.redirectUri = in.readUTF();
this.createDt = in.readObject();
this.updateDt = in.readObject();
}
示例11: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
this.userId = in.readUTF();
this.userType = User.UserTypeEnum.fromValue(in.readUTF());
this.firstName = in.readUTF();
this.lastName = in.readUTF();
this.email = in.readUTF();
this.password = in.readUTF();
this.createDt = in.readObject();
this.updateDt = in.readObject();
}
示例12: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
id = in.readInt();
topicName = in.readUTF();
publisherId = in.readUTF();
message = in.readByteArray();
int rawInt = in.readInt();
qos = rawInt != Byte.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;
isRetain = in.readBoolean();
}
示例13: read
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public RemoteCommand read(ObjectDataInput objectDataInput) throws IOException {
String commandJson = objectDataInput.readUTF();
return CommandJson.fromString(commandJson, commandTypeMatcher, objectMapper)
.map(RemoteCommand::processing)
.orElseThrow(() -> new IllegalArgumentException("No command type matcher found for command " + commandJson));
}
示例14: readDisassembled
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
private static CacheEntry readDisassembled(final ObjectDataInput in)
throws IOException, IllegalAccessException, InvocationTargetException, InstantiationException {
int length = in.readInt();
Serializable[] disassembledState = new Serializable[length];
for (int i = 0; i < length; i++) {
disassembledState[i] = in.readObject();
}
String subclass = in.readUTF();
Object version = in.readObject();
return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, version);
}
示例15: readData
import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(final ObjectDataInput in) throws IOException {
super.readData(in);
concurrent = in.readBoolean();
markerId = in.readUTF();
multiplicity = in.readInt();
timeout = in.readLong();
expiredTimestamp = in.readLong();
}