Tabnine Logo
Streams.copyToByteArray
Code IndexAdd Tabnine to your IDE (free)

How to use
copyToByteArray
method
in
org.elasticsearch.common.io.Streams

Best Java code snippets using org.elasticsearch.common.io.Streams.copyToByteArray (Showing top 5 results out of 315)

origin: sonian/elasticsearch-jetty

public JettyHttpServerRestRequest(HttpServletRequest request) throws IOException {
  this.request = request;
  this.opaqueId = request.getHeader("X-Opaque-Id");
  this.method = Method.valueOf(request.getMethod());
  this.params = new HashMap<String, String>();
  if (request.getQueryString() != null) {
    RestUtils.decodeQueryString(request.getQueryString(), 0, params);
  }
  content = new BytesArray(Streams.copyToByteArray(request.getInputStream()));
  request.setAttribute(REQUEST_CONTENT_ATTRIBUTE, content);
}
origin: salyh/elasticsearch-security-plugin

public TomcatHttpServerRestRequest(final HttpServletRequest request)
    throws IOException {
  this.request = request;
  opaqueId = request.getHeader("X-Opaque-Id");
  method = Method.valueOf(request.getMethod());
  params = new HashMap<String, String>();
  log.debug("HttpServletRequest impl class: " + request.getClass());
  log.debug("HttpServletRequest ru: " + request.getRemoteUser());
  log.debug("HttpServletRequest up: " + request.getUserPrincipal());
  //log.debug("HttpServletRequest up: " + request.getUserPrincipal().getClass().toString());
  if (request.getQueryString() != null) {
    RestUtils.decodeQueryString(request.getQueryString(), 0,
        params);
  }
  content = new BytesArray(Streams.copyToByteArray(request
      .getInputStream()));
  request.setAttribute(REQUEST_CONTENT_ATTRIBUTE, content);
}
origin: jprante/elasticsearch-skywalker

long version = Long.parseLong(stateFile.getName().substring("global-".length()));
if (version > highestVersion) {
  byte[] data = Streams.copyToByteArray(new FileInputStream(stateFile));
  if (data.length == 0) {
    continue;
origin: jprante/elasticsearch-skywalker

long version = Long.parseLong(stateFile.getName().substring("state-".length()));
if (version > highestVersion) {
  byte[] data = Streams.copyToByteArray(new FileInputStream(stateFile));
  if (data.length == 0) {
    continue;
origin: jprante/elasticsearch-transport-websocket

  byte[] data = Streams.copyToByteArray(file);
  channel.sendResponse(new BytesRestResponse(OK, guessMimeType(sitePath), data));
} catch (IOException e) {
org.elasticsearch.common.ioStreamscopyToByteArray

Popular methods of Streams

  • copyToString
    Copy the contents of the given Reader into a String. Closes the reader when done.
  • copy
    Copy the contents of the given byte array to the given OutputStream. Closes the stream when done.
  • readAllLines
  • readFully
  • flushOnCloseStream
    Wraps the given BytesStream in a StreamOutput that simply flushes when close is called.
  • copyToStringFromClasspath

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JPanel (javax.swing)
  • Top plugins for Android Studio
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