congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SnappyInputStream.read
Code IndexAdd Tabnine to your IDE (free)

How to use
read
method
in
org.xerial.snappy.SnappyInputStream

Best Java code snippets using org.xerial.snappy.SnappyInputStream.read (Showing top 14 results out of 315)

origin: redisson/redisson

/**
 * Read int array from the stream
 *
 * @param d
 * @return the total number of bytes read into the buffer, or -1 if there is
 * no more data because the end of the stream has been reached.
 * @throws IOException
 */
public int read(int[] d)
    throws IOException
{
  return read(d, 0, d.length);
}
origin: redisson/redisson

/**
 * Read long array from the stream
 *
 * @param d
 * @return the total number of bytes read into the buffer, or -1 if there is
 * no more data because the end of the stream has been reached.
 * @throws IOException
 */
public int read(long[] d)
    throws IOException
{
  return read(d, 0, d.length);
}
origin: redisson/redisson

/**
 * Read float array from the stream
 *
 * @param d
 * @return the total number of bytes read into the buffer, or -1 if there is
 * no more data because the end of the stream has been reached.
 * @throws IOException
 */
public int read(float[] d)
    throws IOException
{
  return read(d, 0, d.length);
}
origin: redisson/redisson

/**
 * Read double array from the stream
 *
 * @param d
 * @return the total number of bytes read into the buffer, or -1 if there is
 * no more data because the end of the stream has been reached.
 * @throws IOException
 */
public int read(double[] d)
    throws IOException
{
  return read(d, 0, d.length);
}
origin: redisson/redisson

/**
 * Read short array from the stream
 *
 * @param d
 * @return the total number of bytes read into the buffer, or -1 if there is
 * no more data because the end of the stream has been reached.
 * @throws IOException
 */
public int read(short[] d)
    throws IOException
{
  return read(d, 0, d.length);
}
origin: pentaho/pentaho-kettle

@Override
public int read() throws IOException {
 return ( (SnappyInputStream) delegate ).read();
}
origin: Netflix/Priam

  private void decompress(InputStream input, OutputStream output) throws IOException {
    byte data[] = new byte[BUFFER];
    try (BufferedOutputStream dest1 = new BufferedOutputStream(output, BUFFER);
        SnappyInputStream is = new SnappyInputStream(new BufferedInputStream(input))) {
      int c;
      while ((c = is.read(data, 0, BUFFER)) != -1) {
        dest1.write(data, 0, c);
      }
    }
  }
}
origin: redisson/redisson

/**
 * Reads the next byte of uncompressed data from the input stream. The value
 * byte is returned as an int in the range 0 to 255. If no byte is available
 * because the end of the stream has been reached, the value -1 is returned.
 * This method blocks until input data is available, the end of the stream
 * is detected, or an exception is thrown.
 */
/* (non-Javadoc)
 * @see java.io.InputStream#read()
 */
@Override
public int read()
    throws IOException
{
  if (uncompressedCursor < uncompressedLimit) {
    return uncompressed[uncompressedCursor++] & 0xFF;
  }
  else {
    if (hasNextChunk()) {
      return read();
    }
    else {
      return -1;
    }
  }
}
origin: apache/flume

int read = snappyIn.read(buf);
if (read == -1) {
 break;
origin: apache/nifi

while ((len = sis.read(buffer)) > 0) {
  out.write(buffer, 0, len);
origin: eu.fbk.twm/twm-index

public Decompress(File in, File out) {
  long begin = System.currentTimeMillis();
  logger.info("decompressing" + new Date() + "...");
  logger.info("in:\t" + in + " (" + df.format(in.length()) + ")");
  logger.info("out:\t" + out);
  byte[] buffer = new byte[1024];
  try {
    SnappyInputStream sis = new SnappyInputStream(new FileInputStream(in));
    FileOutputStream fos = new FileOutputStream(out);
    int len;
    while ((len = sis.read(buffer)) > 0) {
      fos.write(buffer, 0, len);
    }
    sis.close();
    fos.close();
  } catch (IOException e) {
    logger.error(e);
  }
  long end = System.currentTimeMillis();
  logger.info("decompression done in " + df.format(end - begin) + " ms (" + new Date() + ")");
}
origin: mesosphere/dcos-cassandra-service

  @Override
  public void decompress(InputStream source, OutputStream destination)
      throws IOException {
    SnappyInputStream compressedInputStream = null;
    BufferedOutputStream output = null;
    try {
      compressedInputStream = new SnappyInputStream(
          new BufferedInputStream(source));
      output = new BufferedOutputStream(destination, DEFAULT_BUFFER_SIZE);

      int bytesRead;
      byte[] data = new byte[DEFAULT_BUFFER_SIZE];
      while ((bytesRead = compressedInputStream.read(data, 0,
          DEFAULT_BUFFER_SIZE)) != -1) {
        output.write(data, 0, bytesRead);
      }
    } finally {
      IOUtils.closeQuietly(compressedInputStream);
      IOUtils.closeQuietly(output);
    }
  }
}
origin: org.apache.flume.flume-ng-channels/flume-file-channel

int read = snappyIn.read(buf);
if (read == -1) {
 break;
origin: com.netflix.astyanax/astyanax-cassandra

value = snappy.read();
if (value != -1) {
  baos.write(value);
org.xerial.snappySnappyInputStreamread

Javadoc

Reads the next byte of uncompressed data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Popular methods of SnappyInputStream

  • <init>
  • close
  • hasNextChunk
  • isValidHeader
  • rawRead
    Read uncompressed data into the specified array
  • readFully
  • readHeader
  • readNext
    Read next len bytes

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • Menu (java.awt)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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