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

How to use
CachedStreamInput
in
org.elasticsearch.common.io.stream

Best Java code snippets using org.elasticsearch.common.io.stream.CachedStreamInput (Showing top 3 results out of 315)

origin: medcl/elasticsearch-partialupdate

public static Map<String, Object> sourceAsMap(byte[] bytes, int offset,
                       int length, boolean unsafe) {
  XContentParser parser = null;
  try {
    if (isCompressed(bytes, offset, length)) {
      BytesStreamInput siBytes = new BytesStreamInput(bytes, offset,
          length, unsafe);
      HandlesStreamInput siLzf = CachedStreamInput
          .cachedHandles(siBytes);
      XContentType contentType = XContentFactory.xContentType(siLzf);
      siLzf.reset();
      parser = XContentFactory.xContent(contentType).createParser(
          siLzf);
      return parser.map();
    } else {
      parser = XContentFactory.xContent(bytes, offset, length)
          .createParser(bytes, offset, length);
      return parser.map();
    }
  } catch (Exception e) {
    throw new ElasticsearchParseException(
        "Failed to parse source to map", e);
  } finally {
    if (parser != null) {
      parser.close();
    }
  }
}
origin: medcl/elasticsearch-partialupdate

public static Map<String, Object> sourceAsMap(byte[] bytes, int offset,
                       int length) {
  XContentParser parser = null;
  try {
    if (isCompressed(bytes, offset, length)) {
      BytesStreamInput siBytes = new BytesStreamInput(bytes, offset,
          length, true);
      HandlesStreamInput siLzf = CachedStreamInput
          .cachedHandles(siBytes);
      XContentType contentType = XContentFactory.xContentType(siLzf);
      siLzf.reset();
      parser = XContentFactory.xContent(contentType).createParser(
          siLzf);
      return parser.map();
    } else {
      parser = XContentFactory.xContent(bytes, offset, length)
          .createParser(bytes, offset, length);
      return parser.map();
    }
  } catch (Exception e) {
    throw new ElasticsearchParseException(
        "Failed to parse source to map", e);
  } finally {
    if (parser != null) {
      parser.close();
    }
  }
}
origin: jprante/elasticsearch-transport-websocket

StreamInput wrappedStream = CachedStreamInput.cachedHandles(streamIn);
org.elasticsearch.common.io.streamCachedStreamInput

Most used methods

  • cachedHandles

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Sublime Text plugins
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