本文整理了Java中com.esotericsoftware.kryo.Kryo.getDepth()
方法的一些代码示例,展示了Kryo.getDepth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Kryo.getDepth()
方法的具体详情如下:
包路径:com.esotericsoftware.kryo.Kryo
类名称:Kryo
方法名:getDepth
[英]Returns the number of child objects away from the object graph root.
[中]返回远离对象图根的子对象数。
代码示例来源:origin: com.esotericsoftware/kryo
public Registration readClass (Input input) {
int classID = input.readVarInt(true);
switch (classID) {
case Kryo.NULL:
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Read", null);
return null;
case NAME + 2: // Offset for NAME and NULL.
return readName(input);
}
if (classID == memoizedClassId) return memoizedClassIdValue;
Registration registration = idToRegistration.get(classID - 2);
if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
if (TRACE) trace("kryo", "Read class " + (classID - 2) + ": " + className(registration.getType()));
memoizedClassId = classID;
memoizedClassIdValue = registration;
return registration;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
public Registration readClass (Input input) {
int classID = input.readVarInt(true);
switch (classID) {
case Kryo.NULL:
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Read", null);
return null;
case NAME + 2: // Offset for NAME and NULL.
return readName(input);
}
if (classID == memoizedClassId) return memoizedClassIdValue;
Registration registration = idToRegistration.get(classID - 2);
if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
if (TRACE) trace("kryo", "Read class " + (classID - 2) + ": " + className(registration.getType()));
memoizedClassId = classID;
memoizedClassIdValue = registration;
return registration;
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
public Registration readClass (Input input) {
int classID = input.readVarInt(true);
switch (classID) {
case Kryo.NULL:
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Read", null);
return null;
case NAME + 2: // Offset for NAME and NULL.
return readName(input);
}
if (classID == memoizedClassId) return memoizedClassIdValue;
Registration registration = idToRegistration.get(classID - 2);
if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
if (TRACE) trace("kryo", "Read class " + (classID - 2) + ": " + className(registration.getType()));
memoizedClassId = classID;
memoizedClassIdValue = registration;
return registration;
}
代码示例来源:origin: svn2github/kryo
public Registration readClass (Input input) {
int classID = input.readVarInt(true);
switch (classID) {
case Kryo.NULL:
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Read", null);
return null;
case NAME + 2: // Offset for NAME and NULL.
return readName(input);
}
if (classID == memoizedClassId) return memoizedClassIdValue;
Registration registration = idToRegistration.get(classID - 2);
if (registration == null) throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
if (TRACE) trace("kryo", "Read class " + (classID - 2) + ": " + className(registration.getType()));
memoizedClassId = classID;
memoizedClassIdValue = registration;
return registration;
}
代码示例来源:origin: hank-whu/turbo-rpc
public Registration readClass(Input input) {
int classID = input.readVarInt(true);
switch (classID) {
case Kryo.NULL:
if (TRACE || (DEBUG && kryo.getDepth() == 1))
log("Read", null);
return null;
case NAME + 2: // Offset for NAME and NULL.
return readName(input);
}
if (classID == memoizedClassId)
return memoizedClassIdValue;
Registration registration = idToRegistration.get(classID - 2);
if (registration == null)
throw new KryoException("Encountered unregistered class ID: " + (classID - 2));
if (TRACE)
trace("kryo", "Read class " + (classID - 2) + ": " + className(registration.getType()));
memoizedClassId = classID;
memoizedClassIdValue = registration;
return registration;
}
代码示例来源:origin: com.esotericsoftware/kryo
public Registration writeClass (Output output, Class type) {
if (type == null) {
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Write", null);
output.writeVarInt(Kryo.NULL, true);
return null;
}
Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type, registration);
else {
if (TRACE) trace("kryo", "Write class " + registration.getId() + ": " + className(type));
output.writeVarInt(registration.getId() + 2, true);
}
return registration;
}
代码示例来源:origin: com.esotericsoftware.kryo/kryo
public Registration writeClass (Output output, Class type) {
if (type == null) {
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Write", null);
output.writeVarInt(Kryo.NULL, true);
return null;
}
Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type, registration);
else {
if (TRACE) trace("kryo", "Write class " + registration.getId() + ": " + className(type));
output.writeVarInt(registration.getId() + 2, true);
}
return registration;
}
代码示例来源:origin: com.esotericsoftware/kryo-shaded
public Registration writeClass (Output output, Class type) {
if (type == null) {
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Write", null);
output.writeVarInt(Kryo.NULL, true);
return null;
}
Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type, registration);
else {
if (TRACE) trace("kryo", "Write class " + registration.getId() + ": " + className(type));
output.writeVarInt(registration.getId() + 2, true);
}
return registration;
}
代码示例来源:origin: svn2github/kryo
public Registration writeClass (Output output, Class type) {
if (type == null) {
if (TRACE || (DEBUG && kryo.getDepth() == 1)) log("Write", null);
output.writeVarInt(Kryo.NULL, true);
return null;
}
Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type, registration);
else {
if (TRACE) trace("kryo", "Write class " + registration.getId() + ": " + className(type));
output.writeVarInt(registration.getId() + 2, true);
}
return registration;
}
代码示例来源:origin: hank-whu/turbo-rpc
public Registration writeClass(Output output, Class type) {
if (type == null) {
if (TRACE || (DEBUG && kryo.getDepth() == 1))
log("Write", null);
output.writeVarInt(Kryo.NULL, true);
return null;
}
Registration registration = kryo.getRegistration(type);
if (registration.getId() == NAME)
writeName(output, type, registration);
else {
if (TRACE)
trace("kryo", "Write class " + registration.getId() + ": " + className(type));
output.writeVarInt(registration.getId() + 2, true);
}
return registration;
}
内容来源于网络,如有侵权,请联系作者删除!