Package java.util.zip

Examples of java.util.zip.Inflater.reset()


            inflater.finished();

            byte[] out = new byte[uncompressedSize];
            inflater.inflate(out);

            inflater.reset();
            return out;

        } catch (DataFormatException e) {
            throw new IOException("Input Stream is corrupt: " + e);
        }
View Full Code Here


      }
    } catch (DataFormatException dfe) {
      throw new CorruptObjectException(MessageFormat.format(JGitText
          .get().packfileCorruptionDetected, dfe.getMessage()));
    } finally {
      inf.reset();
    }
  }

  private static class DeltaChain extends ObjectId {
    UnresolvedDelta head;
View Full Code Here

    }

    public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException
    {
        Inflater inf = inflater.get();
        inf.reset();
        inf.setInput(input, inputOffset, inputLength);
        if (inf.needsInput())
            return 0;

        // We assume output is big enough
View Full Code Here

    inflate.setInput(byteArray);
    assertFalse(
        "methodNeedsInput returned true when the input buffer is full",
        inflate.needsInput());

    inflate.reset();
    byte byteArrayEmpty[] = new byte[0];
    inflate.setInput(byteArrayEmpty);
    assertTrue(
        "needsInput give wrong boolean value as a result of an empty input buffer",
        inflate.needsInput());
View Full Code Here

        0, outPutInf[byteArray.length]);

    // testing that resetting the inflater will also return the correct
    // decompressed data

    inflate.reset();
    try {
      while (!(inflate.finished())) {
        if (inflate.needsInput()) {
          inflate.setInput(outPutBuff1);
        }
View Full Code Here

    inflate.setInput(byteArray, offSet, length);
    assertTrue(
        "setInputBII did not deliver the right number of bytes to the input buffer",
        inflate.getRemaining() == length);
    // boundary check
    inflate.reset();
    int r = 0;
    try {
      inflate.setInput(byteArray, 100, 100);
    } catch (ArrayIndexOutOfBoundsException e) {
      r = 1;
View Full Code Here

    int r = 0;
    Inflater inflate = new Inflater();
    inflate.setInput(byteArray);
    inflate.end();
    try {
      inflate.reset();
      inflate.setInput(byteArray);
    } catch (NullPointerException e) {
      r = 1;
    }
    assertEquals("inflate can still be used after end is called", 1, r);
View Full Code Here

    assertTrue(
        "the total number of bytes to be compressed does not equal the total bytes decompressed",
        inflate.getTotalOut() == deflate.getTotalIn());

    // testing inflate(byte,int,int)
    inflate.reset();
    y = 0;
    int offSet = 0;// seems only can start as 0
    int length = 4;
    try {
      while (!(inflate.finished())) {
View Full Code Here

    }
    assertEquals("final decompressed data contained more bytes than original - inflateB",
        0, outPutInf[byteArray.length]);

    // test boundary checks
    inflate.reset();
    int r = 0;
    int offSet = 0;
    int lengthError = 101;
    try {
      if (inflate.needsInput()) {
View Full Code Here

    }

    public int uncompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset) throws IOException
    {
        Inflater inf = inflater.get();
        inf.reset();
        inf.setInput(input, inputOffset, inputLength);
        if (inf.needsInput())
            return 0;

        // We assume output is big enough
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.