congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Writeable$Writer
Code IndexAdd Tabnine to your IDE (free)

How to use
Writeable$Writer
in
org.elasticsearch.common.io.stream

Best Java code snippets using org.elasticsearch.common.io.stream.Writeable$Writer (Showing top 15 results out of 315)

origin: org.elasticsearch/elasticsearch

  writer.write(this, value);
} else {
  throw new IOException("can not write type [" + type + "]");
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  writer.write(this, value);
} else {
  throw new IOException("can not write type [" + type + "]");
origin: com.strapdata.elasticsearch/elasticsearch

  writer.write(this, value);
} else {
  throw new IOException("can not write type [" + type + "]");
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type {@link List}s.
 * <pre><code>
 * Map&lt;String, List&lt;String&gt;&gt; map = ...;
 * out.writeMapOfLists(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMapOfLists(final Map<K, List<V>> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
    throws IOException {
  writeMap(map, keyWriter, (stream, list) -> {
    writeVInt(list.size());
    for (final V value : list) {
      valueWriter.write(this, value);
    }
  });
}
origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type {@link List}s.
 * <pre><code>
 * Map&lt;String, List&lt;String&gt;&gt; map = ...;
 * out.writeMapOfLists(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMapOfLists(final Map<K, List<V>> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
    throws IOException {
  writeMap(map, keyWriter, (stream, list) -> {
    writeVInt(list.size());
    for (final V value : list) {
      valueWriter.write(this, value);
    }
  });
}
origin: apache/servicemix-bundles

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type.
 * <pre><code>
 * Map&lt;String, String&gt; map = ...;
 * out.writeMap(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMap(final Map<K, V> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
  throws IOException {
  writeVInt(map.size());
  for (final Map.Entry<K, V> entry : map.entrySet()) {
    keyWriter.write(this, entry.getKey());
    valueWriter.write(this, entry.getValue());
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type.
 * <pre><code>
 * Map&lt;String, String&gt; map = ...;
 * out.writeMap(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMap(final Map<K, V> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
  throws IOException {
  writeVInt(map.size());
  for (final Map.Entry<K, V> entry : map.entrySet()) {
    keyWriter.write(this, entry.getKey());
    valueWriter.write(this, entry.getValue());
  }
}
origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type.
 * <pre><code>
 * Map&lt;String, String&gt; map = ...;
 * out.writeMap(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMap(final Map<K, V> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
  throws IOException {
  writeVInt(map.size());
  for (final Map.Entry<K, V> entry : map.entrySet()) {
    keyWriter.write(this, entry.getKey());
    valueWriter.write(this, entry.getValue());
  }
}
origin: apache/servicemix-bundles

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type {@link List}s.
 * <pre><code>
 * Map&lt;String, List&lt;String&gt;&gt; map = ...;
 * out.writeMapOfLists(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMapOfLists(final Map<K, List<V>> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
    throws IOException {
  writeMap(map, keyWriter, (stream, list) -> {
    writeVInt(list.size());
    for (final V value : list) {
      valueWriter.write(this, value);
    }
  });
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Writes the specified array to the stream using the specified {@link Writer} for each element in the array. This method can be seen as
 * writer version of {@link 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.
 *
 * @param writer the writer used to write individual elements
 * @param array the array
 * @param <T> the type of the elements of the array
 * @throws IOException if an I/O exception occurs while writing the array
 */
public <T> void writeArray(final Writer<T> writer, final T[] array) throws IOException {
  writeVInt(array.length);
  for (T value : array) {
    writer.write(this, value);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Writes a collection of generic objects via a {@link Writer}
 */
public <T> void writeCollection(Collection<T> collection, Writer<T> writer) throws IOException {
  writeVInt(collection.size());
  for (T val: collection) {
    writer.write(this, val);
  }
}
origin: org.elasticsearch/elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type {@link List}s.
 * <pre><code>
 * Map&lt;String, List&lt;String&gt;&gt; map = ...;
 * out.writeMapOfLists(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMapOfLists(final Map<K, List<V>> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
    throws IOException {
  writeMap(map, keyWriter, (stream, list) -> {
    writeVInt(list.size());
    for (final V value : list) {
      valueWriter.write(this, value);
    }
  });
}
origin: org.elasticsearch/elasticsearch

/**
 * Write a {@link Map} of {@code K}-type keys to {@code V}-type.
 * <pre><code>
 * Map&lt;String, String&gt; map = ...;
 * out.writeMap(map, StreamOutput::writeString, StreamOutput::writeString);
 * </code></pre>
 *
 * @param keyWriter The key writer
 * @param valueWriter The value writer
 */
public final <K, V> void writeMap(final Map<K, V> map, final Writer<K> keyWriter, final Writer<V> valueWriter)
  throws IOException {
  writeVInt(map.size());
  for (final Map.Entry<K, V> entry : map.entrySet()) {
    keyWriter.write(this, entry.getKey());
    valueWriter.write(this, entry.getValue());
  }
}
origin: org.elasticsearch/elasticsearch

/**
 * Writes the specified array to the stream using the specified {@link Writer} for each element in the array. This method can be seen as
 * writer version of {@link 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.
 *
 * @param writer the writer used to write individual elements
 * @param array the array
 * @param <T> the type of the elements of the array
 * @throws IOException if an I/O exception occurs while writing the array
 */
public <T> void writeArray(final Writer<T> writer, final T[] array) throws IOException {
  writeVInt(array.length);
  for (T value : array) {
    writer.write(this, value);
  }
}
origin: org.elasticsearch/elasticsearch

/**
 * Writes a collection of generic objects via a {@link Writer}
 */
public <T> void writeCollection(Collection<T> collection, Writer<T> writer) throws IOException {
  writeVInt(collection.size());
  for (T val: collection) {
    writer.write(this, val);
  }
}
org.elasticsearch.common.io.streamWriteable$Writer

Javadoc

Reference to a method that can write some object to a StreamOutput.

By convention this is a method from StreamOutput itself (e.g., StreamOutput#writeString). If the value can be null, then the "optional" variant of methods should be used!

Most classes should implement Writeable and the Writeable#writeTo(StreamOutput) method should use StreamOutput methods directly or this indirectly:

 
public void writeTo(StreamOutput out) throws IOException { 
out.writeVInt(someValue); 
out.writeMapOfLists(someMap, StreamOutput::writeString, StreamOutput::writeString); 
} 

Most used methods

  • write
    Write V-type value to the output stream.

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
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