org.apache.tinkerpop.shaded.kryo.io.Output.writeInt()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(129)

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

Output.writeInt介绍

暂无

代码示例

代码示例来源:origin: JanusGraph/janusgraph

@Override
public void write(Kryo kryo, Output output, P p) {
  output.writeString(
      p instanceof ConnectiveP ? (p instanceof AndP ? "and" : "or") : p.getBiPredicate().toString());
  if (p instanceof ConnectiveP || p.getValue() instanceof Collection) {
    output.writeByte((byte) 0);
    final Collection<?> coll = p instanceof ConnectiveP ? ((ConnectiveP<?>) p).getPredicates()
        : (Collection) p.getValue();
    output.writeInt(coll.size());
    coll.forEach(v -> kryo.writeClassAndObject(output, v));
  } else {
    output.writeByte((byte) 1);
    kryo.writeClassAndObject(output, p.getValue());
  }
}

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

@Override
public void writeInt(final int i) {
  shadedOutput.writeInt(i);
}

代码示例来源:origin: hugegraph/hugegraph

private static void writeEntry(Kryo kryo,
                Output output,
                Map<HugeKeys, Object> schema) {
  /* Write columns size and data */
  output.writeInt(schema.keySet().size());
  for (Map.Entry<HugeKeys, Object> entry : schema.entrySet()) {
    kryo.writeObject(output, entry.getKey());
    kryo.writeClassAndObject(output, entry.getValue());
  }
}

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

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

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

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

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

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: org.apache.tinkerpop/gremlin-core

@Override
public void writeInt(final int i) {
  shadedOutput.writeInt(i);
}

代码示例来源:origin: com.baidu.hugegraph/hugegraph-core

private static void writeEntry(Kryo kryo,
                Output output,
                Map<HugeKeys, Object> schema) {
  /* Write columns size and data */
  output.writeInt(schema.keySet().size());
  for (Map.Entry<HugeKeys, Object> entry : schema.entrySet()) {
    kryo.writeObject(output, entry.getKey());
    kryo.writeClassAndObject(output, entry.getValue());
  }
}

代码示例来源:origin: org.apache.tinkerpop/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: io.shiftleft/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: org.apache.tinkerpop/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: org.apache.tinkerpop/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: io.shiftleft/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: io.shiftleft/tinkergraph-gremlin

@Override
public void write(final Kryo kryo, final Output output, final TinkerGraph graph) {
  try (final ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
    GryoWriter.build().mapper(() -> kryo).create().writeGraph(stream, graph);
    final byte[] bytes = stream.toByteArray();
    output.writeInt(bytes.length);
    output.write(bytes);
  } catch (Exception io) {
    throw new RuntimeException(io);
  }
}

代码示例来源:origin: pietermartin/sqlg

@Override
public void write(Kryo kryo, Output output) {
  output.writeString(this.getSchemaTable().getSchema());
  output.writeString(this.getSchemaTable().getTable());
  if (hasSequenceId()) {
    output.writeString("s");
    output.writeLong(this.getID().sequenceId);
  } else {
    output.writeString("i");
    output.writeInt(getIdentifiers().size());
    for (Comparable identifier : getIdentifiers()) {
      output.writeString((CharSequence) identifier);
    }
  }
}

代码示例来源:origin: org.umlg/sqlg-core

@Override
public void write(Kryo kryo, Output output) {
  output.writeString(this.getSchemaTable().getSchema());
  output.writeString(this.getSchemaTable().getTable());
  if (hasSequenceId()) {
    output.writeString("s");
    output.writeLong(this.getID().sequenceId);
  } else {
    output.writeString("i");
    output.writeInt(getIdentifiers().size());
    for (Comparable identifier : getIdentifiers()) {
      output.writeString((CharSequence) identifier);
    }
  }
}

相关文章