com.esotericsoftware.kryo.util.Util.log()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(13.7k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中com.esotericsoftware.kryo.util.Util.log()方法的一些代码示例,展示了Util.log()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.log()方法的具体详情如下:
包路径:com.esotericsoftware.kryo.util.Util
类名称:Util
方法名:log

Util.log介绍

[英]Logs a message about an object. The log level and the string format of the object depend on the object type.
[中]记录有关对象的消息。对象的日志级别和字符串格式取决于对象类型。

代码示例

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Writes an object using the specified serializer. The registered serializer is ignored. */
public void writeObject (Output output, Object object, Serializer serializer) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      serializer.setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    serializer.write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware/kryo

/** Writes an object using the specified serializer. The registered serializer is ignored. */
public void writeObject (Output output, Object object, Serializer serializer) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      serializer.setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    serializer.write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

/** Writes an object using the specified serializer. The registered serializer is ignored. */
public void writeObject (Output output, Object object, Serializer serializer) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      serializer.setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    serializer.write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: svn2github/kryo

/** Writes an object using the specified serializer. The registered serializer is ignored. */
public void writeObject (Output output, Object object, Serializer serializer) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      serializer.setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    serializer.write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Reads an object using the specified serializer. The registered serializer is ignored. */
public <T> T readObject (Input input, Class<T> type, Serializer serializer) {
  if (input == null) throw new IllegalArgumentException("input cannot be null.");
  if (type == null) throw new IllegalArgumentException("type cannot be null.");
  if (serializer == null) throw new IllegalArgumentException("serializer cannot be null.");
  beginObject();
  try {
    T object;
    if (references) {
      int stackSize = readReferenceOrNull(input, type, false);
      if (stackSize == REF) return (T)readObject;
      object = (T)serializer.read(this, input, type);
      if (stackSize == readReferenceIds.size) reference(object);
    } else
      object = (T)serializer.read(this, input, type);
    if (TRACE || (DEBUG && depth == 1)) log("Read", object);
    return object;
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware/kryo

/** Writes an object using the registered serializer. */
public void writeObject (Output output, Object object) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      getRegistration(object.getClass()).getSerializer().setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    getRegistration(object.getClass()).getSerializer().write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Writes an object using the registered serializer. */
public void writeObject (Output output, Object object) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      getRegistration(object.getClass()).getSerializer().setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    getRegistration(object.getClass()).getSerializer().write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: svn2github/kryo

/** Writes an object using the registered serializer. */
public void writeObject (Output output, Object object) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      getRegistration(object.getClass()).getSerializer().setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    getRegistration(object.getClass()).getSerializer().write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware/kryo-shaded

/** Writes an object using the registered serializer. */
public void writeObject (Output output, Object object) {
  if (output == null) throw new IllegalArgumentException("output cannot be null.");
  if (object == null) throw new IllegalArgumentException("object cannot be null.");
  beginObject();
  try {
    if (references && writeReferenceOrNull(output, object, false)) {
      getRegistration(object.getClass()).getSerializer().setGenerics(this, null);
      return;
    }
    if (TRACE || (DEBUG && depth == 1)) log("Write", object);
    getRegistration(object.getClass()).getSerializer().write(this, output, object);
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware.kryo/kryo

/** Reads an object using the registered serializer. */
public <T> T readObject (Input input, Class<T> type) {
  if (input == null) throw new IllegalArgumentException("input cannot be null.");
  if (type == null) throw new IllegalArgumentException("type cannot be null.");
  beginObject();
  try {
    T object;
    if (references) {
      int stackSize = readReferenceOrNull(input, type, false);
      if (stackSize == REF) return (T)readObject;
      object = (T)getRegistration(type).getSerializer().read(this, input, type);
      if (stackSize == readReferenceIds.size) reference(object);
    } else
      object = (T)getRegistration(type).getSerializer().read(this, input, type);
    if (TRACE || (DEBUG && depth == 1)) log("Read", object);
    return object;
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源:origin: com.esotericsoftware/kryo

/** Reads an object using the registered serializer. */
public <T> T readObject (Input input, Class<T> type) {
  if (input == null) throw new IllegalArgumentException("input cannot be null.");
  if (type == null) throw new IllegalArgumentException("type cannot be null.");
  beginObject();
  try {
    T object;
    if (references) {
      int stackSize = readReferenceOrNull(input, type, false);
      if (stackSize == REF) return (T)readObject;
      object = (T)getRegistration(type).getSerializer().read(this, input, type);
      if (stackSize == readReferenceIds.size) reference(object);
    } else
      object = (T)getRegistration(type).getSerializer().read(this, input, type);
    if (TRACE || (DEBUG && depth == 1)) log("Read", object);
    return object;
  } finally {
    if (--depth == 0 && autoReset) reset();
  }
}

代码示例来源: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: 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

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;
}

相关文章