Package java.util.zip

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


    }
 
  /** {@inheritDoc} */
  public String[] getItems(String[] Keys, int docid) throws IOException {
    Inflater unzip = inflaterCache.get();
    unzip.reset();
    unzip.setInput(dataSource.read(
        offsetLookup.getOffset(docid), offsetLookup.getLength(docid)
        ));
    byte[] bOut = new byte[recordLength];
    try {
View Full Code Here


    }
 
  /** {@inheritDoc} */
  public String[] getAllItems(int docid) throws IOException {
    Inflater unzip = inflaterCache.get();
    unzip.reset();
    unzip.setInput(dataSource.read(
        offsetLookup.getOffset(docid), offsetLookup.getLength(docid)
        ));
    //unzip.setInput(
    //    dataSource.read(docid2offsets[docid],
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

      finally
      {
        //Reset and put back
        if(decompressor != null)
        {
          decompressor.reset();
          decompressor.setInput(_EMPTY);
          TransientHolder<Inflater> th = TransientHolder.newTransientHolder(decompressor);
          sessionMap.put("PAGE_STATE_INFLATER", th);
        }
      }
View Full Code Here

                                           " compression method: " + method);
            }
            ByteArrayOutputStream bytes = new ByteArrayOutputStream(L * 3);
            byte[] tbuf = new byte[512];
            Inflater inf = new Inflater();
            inf.reset();
            inf.setInput(buf, 1, L - 1);
            try {
                while (!inf.needsInput()) {
                    bytes.write(tbuf, 0, inf.inflate(tbuf));
                }
View Full Code Here

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
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

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.