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

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

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

origin: org.elasticsearch/elasticsearch

public static int readFully(InputStream reader, byte[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: org.elasticsearch/elasticsearch

public static int readFully(Reader reader, char[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: org.elasticsearch/elasticsearch

@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
  if (len < 0)
    throw new IndexOutOfBoundsException();
  final int read = Streams.readFully(is, b, offset, len);
  if (read != len) {
    throw new EOFException();
  }
}
origin: org.elasticsearch/elasticsearch

/**
 * Computes a strong hash value for small files. Note that this method should only be used for files &lt; 1MB
 */
public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {
  final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB
  fileHash.grow(len);
  fileHash.setLength(len);
  final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);
  assert readBytes == len : Integer.toString(readBytes) + " != " + Integer.toString(len);
  assert fileHash.length() == len : Integer.toString(fileHash.length()) + " != " + Integer.toString(len);
}
origin: com.strapdata.elasticsearch/elasticsearch

public static int readFully(Reader reader, char[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: apache/servicemix-bundles

public static int readFully(Reader reader, char[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: harbby/presto-connectors

public static int readFully(Reader reader, char[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public static int readFully(Reader reader, char[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public static int readFully(InputStream reader, byte[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: com.strapdata.elasticsearch/elasticsearch

public static int readFully(InputStream reader, byte[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: apache/servicemix-bundles

public static int readFully(InputStream reader, byte[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: harbby/presto-connectors

public static int readFully(InputStream reader, byte[] dest) throws IOException {
  return readFully(reader, dest, 0, dest.length);
}
origin: com.strapdata.elasticsearch/elasticsearch

@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
  if (len < 0)
    throw new IndexOutOfBoundsException();
  final int read = Streams.readFully(is, b, offset, len);
  if (read != len) {
    throw new EOFException();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
  if (len < 0)
    throw new IndexOutOfBoundsException();
  final int read = Streams.readFully(is, b, offset, len);
  if (read != len) {
    throw new EOFException();
  }
}
origin: apache/servicemix-bundles

@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
  if (len < 0)
    throw new IndexOutOfBoundsException();
  final int read = Streams.readFully(is, b, offset, len);
  if (read != len) {
    throw new EOFException();
  }
}
origin: harbby/presto-connectors

@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
  if (len < 0)
    throw new IndexOutOfBoundsException();
  final int read = Streams.readFully(is, b, offset, len);
  if (read != len) {
    throw new EOFException();
  }
}
origin: harbby/presto-connectors

/**
 * Computes a strong hash value for small files. Note that this method should only be used for files &lt; 1MB
 */
public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {
  final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB
  fileHash.grow(len);
  fileHash.setLength(len);
  final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);
  assert readBytes == len : Integer.toString(readBytes) + " != " + Integer.toString(len);
  assert fileHash.length() == len : Integer.toString(fileHash.length()) + " != " + Integer.toString(len);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Computes a strong hash value for small files. Note that this method should only be used for files &lt; 1MB
 */
public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {
  final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB
  fileHash.grow(len);
  fileHash.setLength(len);
  final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);
  assert readBytes == len : Integer.toString(readBytes) + " != " + Integer.toString(len);
  assert fileHash.length() == len : Integer.toString(fileHash.length()) + " != " + Integer.toString(len);
}
origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Computes a strong hash value for small files. Note that this method should only be used for files &lt; 1MB
 */
public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {
  final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB
  fileHash.grow(len);
  fileHash.setLength(len);
  final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);
  assert readBytes == len : Integer.toString(readBytes) + " != " + Integer.toString(len);
  assert fileHash.length() == len : Integer.toString(fileHash.length()) + " != " + Integer.toString(len);
}
origin: apache/servicemix-bundles

/**
 * Computes a strong hash value for small files. Note that this method should only be used for files &lt; 1MB
 */
public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {
  final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB
  fileHash.grow(len);
  fileHash.setLength(len);
  final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);
  assert readBytes == len : Integer.toString(readBytes) + " != " + Integer.toString(len);
  assert fileHash.length() == len : Integer.toString(fileHash.length()) + " != " + Integer.toString(len);
}
org.elasticsearch.common.ioStreamsreadFully

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.
  • copyToByteArray
  • readAllLines
  • flushOnCloseStream
    Wraps the given BytesStream in a StreamOutput that simply flushes when close is called.
  • copyToStringFromClasspath

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • getSystemService (Context)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top 12 Jupyter Notebook extensions
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