Tabnine Logo
StreamOutput.write
Code IndexAdd Tabnine to your IDE (free)

How to use
write
method
in
org.elasticsearch.common.io.stream.StreamOutput

Best Java code snippets using org.elasticsearch.common.io.stream.StreamOutput.write (Showing top 20 results out of 315)

origin: org.elasticsearch/elasticsearch

public void writeBytesRef(BytesRef bytes) throws IOException {
  if (bytes == null) {
    writeVInt(0);
    return;
  }
  writeVInt(bytes.length);
  write(bytes.bytes, bytes.offset, bytes.length);
}
origin: org.elasticsearch/elasticsearch

@Override
public void writeByte(byte b) throws IOException {
  stream.write(b);
}
origin: org.elasticsearch/elasticsearch

@Override
public void writeTo(StreamOutput out) throws IOException {
  if (out.getVersion().before(Version.V_6_0_0_alpha1)) {
    out.writeShort((short)1); // this maps to InetSocketTransportAddress in 5.x
  }
  byte[] bytes = address.getAddress().getAddress();  // 4 bytes (IPv4) or 16 bytes (IPv6)
  out.writeByte((byte) bytes.length); // 1 byte
  out.write(bytes, 0, bytes.length);
  if (out.getVersion().after(Version.V_5_0_2)) {
    out.writeString(address.getHostString());
  }
  // don't serialize scope ids over the network!!!!
  // these only make sense with respect to the local machine, and will only formulate
  // the address incorrectly remotely.
  out.writeInt(address.getPort());
}
origin: org.elasticsearch/elasticsearch

public void writeText(Text text) throws IOException {
  if (!text.hasBytes()) {
    final String string = text.string();
    spare.copyChars(string);
    writeInt(spare.length());
    write(spare.bytes(), 0, spare.length());
  } else {
    BytesReference bytes = text.bytes();
    writeInt(bytes.length());
    bytes.writeTo(this);
  }
}
origin: jprante/elasticsearch-skywalker

  @Override
  public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    clusterName.writeTo(out);
    ClusterState.Builder.writeTo(clusterState, out);
    out.write(files.size());
    for (File file : files) {
      out.writeString(file.getAbsolutePath());
    }
  }
}
origin: harbby/presto-connectors

@Override
public void writeTo(StreamOutput out) throws IOException {
  byte[] bytes = address().getAddress().getAddress();  // 4 bytes (IPv4) or 16 bytes (IPv6)
  out.writeByte((byte) bytes.length); // 1 byte
  out.write(bytes, 0, bytes.length);
  // don't serialize scope ids over the network!!!!
  // these only make sense with respect to the local machine, and will only formulate
  // the address incorrectly remotely.
  out.writeInt(address.getPort());
}
origin: org.elasticsearch/elasticsearch

public void writeIndicesOptions(StreamOutput out) throws IOException {
  EnumSet<Option> options = this.options;
  // never write this out to a pre7.0 version
  if (out.getVersion().before(Version.V_6_6_0) && options.contains(Option.IGNORE_THROTTLED)) {
    options = EnumSet.copyOf(options);
    options.remove(Option.IGNORE_THROTTLED);
  }
  if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
    out.writeEnumSet(options);
    out.writeEnumSet(expandWildcards);
  } else {
    if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha2)) {
      out.write(IndicesOptions.toByte(this));
    } else {
      // if we are talking to a node that doesn't support the newly added flag (ignoreAliases)
      // flip to 0 all the bits starting from the 7th
      out.write(IndicesOptions.toByte(this) & 0x3f);
    }
  }
}
origin: harbby/presto-connectors

public void writeBytesRef(BytesRef bytes) throws IOException {
  if (bytes == null) {
    writeVInt(0);
    return;
  }
  writeVInt(bytes.length);
  write(bytes.bytes, bytes.offset, bytes.length);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public void writeText(Text text) throws IOException {
  if (!text.hasBytes()) {
    final String string = text.string();
    spare.copyChars(string);
    writeInt(spare.length());
    write(spare.bytes(), 0, spare.length());
  } else {
    BytesReference bytes = text.bytes();
    writeInt(bytes.length());
    bytes.writeTo(this);
  }
}
origin: org.elasticsearch/elasticsearch

@Override
public void writeTo(StreamOutput out) throws IOException {
  out.write(processors.size());
  for (ProcessorInfo info : processors) {
    info.writeTo(out);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public void writeBytesRef(BytesRef bytes) throws IOException {
  if (bytes == null) {
    writeVInt(0);
    return;
  }
  writeVInt(bytes.length);
  write(bytes.bytes, bytes.offset, bytes.length);
}
origin: com.strapdata.elasticsearch/elasticsearch

public void writeText(Text text) throws IOException {
  if (!text.hasBytes()) {
    final String string = text.string();
    spare.copyChars(string);
    writeInt(spare.length());
    write(spare.bytes(), 0, spare.length());
  } else {
    BytesReference bytes = text.bytes();
    writeInt(bytes.length());
    bytes.writeTo(this);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public void writeByte(byte b) throws IOException {
  stream.write(b);
}
origin: com.strapdata.elasticsearch/elasticsearch

public void writeBytesRef(BytesRef bytes) throws IOException {
  if (bytes == null) {
    writeVInt(0);
    return;
  }
  writeVInt(bytes.length);
  write(bytes.bytes, bytes.offset, bytes.length);
}
origin: apache/servicemix-bundles

public void writeText(Text text) throws IOException {
  if (!text.hasBytes()) {
    final String string = text.string();
    spare.copyChars(string);
    writeInt(spare.length());
    write(spare.bytes(), 0, spare.length());
  } else {
    BytesReference bytes = text.bytes();
    writeInt(bytes.length());
    bytes.writeTo(this);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public void writeTo(StreamOutput out) throws IOException {
  out.write(processors.size());
  for (ProcessorInfo info : processors) {
    info.writeTo(out);
  }
}
origin: apache/servicemix-bundles

public void writeBytesRef(BytesRef bytes) throws IOException {
  if (bytes == null) {
    writeVInt(0);
    return;
  }
  writeVInt(bytes.length);
  write(bytes.bytes, bytes.offset, bytes.length);
}
origin: harbby/presto-connectors

public void writeText(Text text) throws IOException {
  if (!text.hasBytes()) {
    final String string = text.string();
    spare.copyChars(string);
    writeInt(spare.length());
    write(spare.bytes(), 0, spare.length());
  } else {
    BytesReference bytes = text.bytes();
    writeInt(bytes.length());
    bytes.writeTo(this);
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public void writeTo(StreamOutput out) throws IOException {
  out.write(processors.size());
  for (ProcessorInfo info : processors) {
    info.writeTo(out);
  }
}
origin: apache/servicemix-bundles

@Override
public void writeTo(StreamOutput out) throws IOException {
  out.write(processors.size());
  for (ProcessorInfo info : processors) {
    info.writeTo(out);
  }
}
org.elasticsearch.common.io.streamStreamOutputwrite

Javadoc

Writes the specified array to the stream using the specified Writer for each element in the array. This method can be seen as writer version of StreamInput#readArray(Writeable.Reader,IntFunction). The length of array encoded as a variable-length integer is first written to the stream, and then the elements of the array are written to the stream.

Popular methods of StreamOutput

  • writeString
  • writeVInt
    Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fe
  • writeBoolean
    Writes a boolean.
  • writeOptionalString
  • writeVLong
    Writes a non-negative long in a variable-length format. Writes between one and ten bytes. Smaller va
  • writeInt
    Writes an int as four bytes.
  • getVersion
    The version of the node on the other side of this stream.
  • writeBytesReference
    Writes the bytes reference, including a length header.
  • writeLong
    Writes a long as eight bytes.
  • writeMap
    Write a Map of K-type keys to V-type. Map map = ...; out.writeMap(map, StreamOutpu
  • writeStringArray
  • writeGenericValue
    Notice: when serialization a map, the stream out map with the stream in map maybe have the different
  • writeStringArray,
  • writeGenericValue,
  • writeOptionalWriteable,
  • writeByte,
  • writeFloat,
  • writeOptionalStreamable,
  • writeOptionalBytesReference,
  • writeNamedWriteable,
  • writeStringArrayNullable

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JLabel (javax.swing)
  • Join (org.hibernate.mapping)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now