com.esotericsoftware.kryo.Kryo.getReferences()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(98)

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

Kryo.getReferences介绍

暂无

代码示例

代码示例来源:origin: apache/flink

@Test
  public void validateReferenceMappingEnabled() {
    KryoSerializer<String> serializer = new KryoSerializer<>(String.class, new ExecutionConfig());
    Kryo kryo = serializer.getKryo();
    assertTrue(kryo.getReferences());
  }
}

代码示例来源:origin: com.twitter/chill-java

public Kryo newKryo() {
  Kryo k = KryoInstantiator.this.newKryo();
  /**
   * Kryo 2.17, used in storm, has this method returning void,
   * 2.21 has it returning boolean.
   * Try not to call the method if you don't need to.
   */
  if(k.getReferences() != ref) { k.setReferences(ref); }
  return k;
 }
};

代码示例来源:origin: tv.cntt/chill-scala-2-11

public Kryo newKryo() {
  Kryo k = KryoInstantiator.this.newKryo();
  /**
   * Kryo 2.17, used in storm, has this method returning void,
   * 2.21 has it returning boolean.
   * Try not to call the method if you don't need to.
   */
  if(k.getReferences() != ref) { k.setReferences(ref); }
  return k;
 }
};

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

public String[] read (Kryo kryo, Input input, Class<String[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  String[] array = new String[--length];
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0; i < length; i++) {
      array[i] = kryo.readObjectOrNull(input, String.class, serializer);
    }
  } else {
    for (int i = 0; i < length; i++)
      array[i] = input.readString();
  }
  return array;
}

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

public String[] read (Kryo kryo, Input input, Class<String[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  String[] array = new String[--length];
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0; i < length; i++) {
      array[i] = kryo.readObjectOrNull(input, String.class, serializer);
    }
  } else {
    for (int i = 0; i < length; i++)
      array[i] = input.readString();
  }
  return array;
}

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

public String[] read (Kryo kryo, Input input, Class<String[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  String[] array = new String[--length];
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0; i < length; i++) {
      array[i] = kryo.readObjectOrNull(input, String.class, serializer);
    }
  } else {
    for (int i = 0; i < length; i++)
      array[i] = input.readString();
  }
  return array;
}

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

public String[] read (Kryo kryo, Input input, Class<String[]> type) {
  int length = input.readVarInt(true);
  if (length == NULL) return null;
  String[] array = new String[--length];
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0; i < length; i++) {
      array[i] = kryo.readObjectOrNull(input, String.class, serializer);
    }
  } else {
    for (int i = 0; i < length; i++)
      array[i] = input.readString();
  }
  return array;
}

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

public void write (Kryo kryo, Output output, String[] object) {
  if (object == null) {
    output.writeVarInt(NULL, true);
    return;
  }
  output.writeVarInt(object.length + 1, true);
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0, n = object.length; i < n; i++)
      kryo.writeObjectOrNull(output, object[i], serializer);
  } else {
    for (int i = 0, n = object.length; i < n; i++)
      output.writeString(object[i]);
  }
}

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

public void write (Kryo kryo, Output output, String[] object) {
  if (object == null) {
    output.writeVarInt(NULL, true);
    return;
  }
  output.writeVarInt(object.length + 1, true);
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0, n = object.length; i < n; i++)
      kryo.writeObjectOrNull(output, object[i], serializer);
  } else {
    for (int i = 0, n = object.length; i < n; i++)
      output.writeString(object[i]);
  }
}

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

public void write (Kryo kryo, Output output, String[] object) {
  if (object == null) {
    output.writeVarInt(NULL, true);
    return;
  }
  output.writeVarInt(object.length + 1, true);
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0, n = object.length; i < n; i++)
      kryo.writeObjectOrNull(output, object[i], serializer);
  } else {
    for (int i = 0, n = object.length; i < n; i++)
      output.writeString(object[i]);
  }
}

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

public void write (Kryo kryo, Output output, String[] object) {
  if (object == null) {
    output.writeVarInt(NULL, true);
    return;
  }
  output.writeVarInt(object.length + 1, true);
  if (kryo.getReferences() && kryo.getReferenceResolver().useReferences(String.class)) {
    Serializer serializer = kryo.getSerializer(String.class);
    for (int i = 0, n = object.length; i < n; i++)
      kryo.writeObjectOrNull(output, object[i], serializer);
  } else {
    for (int i = 0, n = object.length; i < n; i++)
      output.writeString(object[i]);
  }
}

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new UnsafeStringField(field);
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new UnsafeStringField(field);
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new AsmStringField();
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new AsmStringField();
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new AsmStringField();
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new UnsafeStringField(field);
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new UnsafeStringField(field);
} else {

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

&& (!ser.kryo.getReferences() || !ser.kryo.getReferenceResolver().useReferences(String.class))) {
  cachedField = new AsmStringField();
} else {

相关文章