com.esotericsoftware.kryo.io.Output.writeString_slow()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(111)

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

Output.writeString_slow介绍

暂无

代码示例

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

/** Writes the length and CharSequence as UTF8, or null. The string can be read using {@link Input#readString()} or
 * {@link Input#readStringBuilder()}.
 * @param value May be null. */
public void writeString (CharSequence value) throws KryoException {
  if (value == null) {
    writeByte(0x80); // 0 means null, bit 8 means UTF8.
    return;
  }
  int charCount = value.length();
  if (charCount == 0) {
    writeByte(1 | 0x80); // 1 means empty string, bit 8 means UTF8.
    return;
  }
  writeUtf8Length(charCount + 1);
  int charIndex = 0;
  if (capacity - position >= charCount) {
    // Try to write 8 bit chars.
    byte[] buffer = this.buffer;
    int position = this.position;
    for (; charIndex < charCount; charIndex++) {
      int c = value.charAt(charIndex);
      if (c > 127) break;
      buffer[position++] = (byte)c;
    }
    this.position = position;
  }
  if (charIndex < charCount) writeString_slow(value, charCount, charIndex);
}

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

/** Writes the length and CharSequence as UTF8, or null. The string can be read using {@link Input#readString()} or
 * {@link Input#readStringBuilder()}.
 * @param value May be null. */
public void writeString (CharSequence value) throws KryoException {
  if (value == null) {
    writeByte(0x80); // 0 means null, bit 8 means UTF8.
    return;
  }
  int charCount = value.length();
  if (charCount == 0) {
    writeByte(1 | 0x80); // 1 means empty string, bit 8 means UTF8.
    return;
  }
  writeUtf8Length(charCount + 1);
  int charIndex = 0;
  if (capacity - position >= charCount) {
    // Try to write 8 bit chars.
    byte[] buffer = this.buffer;
    int position = this.position;
    for (; charIndex < charCount; charIndex++) {
      int c = value.charAt(charIndex);
      if (c > 127) break;
      buffer[position++] = (byte)c;
    }
    this.position = position;
  }
  if (charIndex < charCount) writeString_slow(value, charCount, charIndex);
}

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

/** Writes the length and CharSequence as UTF8, or null. The string can be read using {@link Input#readString()} or
 * {@link Input#readStringBuilder()}.
 * @param value May be null. */
public void writeString (CharSequence value) throws KryoException {
  if (value == null) {
    writeByte(0x80); // 0 means null, bit 8 means UTF8.
    return;
  }
  int charCount = value.length();
  if (charCount == 0) {
    writeByte(1 | 0x80); // 1 means empty string, bit 8 means UTF8.
    return;
  }
  writeUtf8Length(charCount + 1);
  int charIndex = 0;
  if (capacity - position >= charCount) {
    // Try to write 8 bit chars.
    byte[] buffer = this.buffer;
    int position = this.position;
    for (; charIndex < charCount; charIndex++) {
      int c = value.charAt(charIndex);
      if (c > 127) break;
      buffer[position++] = (byte)c;
    }
    this.position = position;
  }
  if (charIndex < charCount) writeString_slow(value, charCount, charIndex);
}

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

/** Writes the length and CharSequence as UTF8, or null. The string can be read using {@link Input#readString()} or
 * {@link Input#readStringBuilder()}.
 * @param value May be null. */
public void writeString (CharSequence value) throws KryoException {
  if (value == null) {
    writeByte(0x80); // 0 means null, bit 8 means UTF8.
    return;
  }
  int charCount = value.length();
  if (charCount == 0) {
    writeByte(1 | 0x80); // 1 means empty string, bit 8 means UTF8.
    return;
  }
  writeUtf8Length(charCount + 1);
  int charIndex = 0;
  if (capacity - position >= charCount) {
    // Try to write 8 bit chars.
    byte[] buffer = this.buffer;
    int position = this.position;
    for (; charIndex < charCount; charIndex++) {
      int c = value.charAt(charIndex);
      if (c > 127) break;
      buffer[position++] = (byte)c;
    }
    this.position = position;
  }
  if (charIndex < charCount) writeString_slow(value, charCount, charIndex);
}

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

if (charIndex < charCount) writeString_slow(value, charCount, charIndex);

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

if (charIndex < charCount) writeString_slow(value, charCount, charIndex);

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

if (charIndex < charCount) writeString_slow(value, charCount, charIndex);

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

if (charIndex < charCount) writeString_slow(value, charCount, charIndex);

相关文章