Package java.util.zip

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


        newException.initCause(e);
        throw newException;
      }
    }
 
    decompressor.end();
   
    // Get the decompressed data
    return bos.toByteArray();
  }
 
View Full Code Here


            // Decompress the bytes
            Inflater decompresser = new Inflater();
            decompresser.setInput(pContents[0], 0, readbytes);
            byte[] result = new byte[oleLength];
            int resultLength = decompresser.inflate(result);
            decompresser.end();

            //return the base64 string of the uncompressed data           
            return Base64.encodeBytes(result);
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

        // Regression for HARMONY-2508
        Inflater inflater = new Inflater();
        byte[] b = new byte[1024];
        assertEquals(0, inflater.inflate(b));
        inflater.end();
       
        // Regression for HARMONY-2510
        inflater = new Inflater();
        byte[] input = new byte[] { -1 };
        inflater.setInput(input);
View Full Code Here

    byte byteArray[] = { 5, 2, 3, 7, 8 };

    int r = 0;
    Inflater inflate = new Inflater();
    inflate.setInput(byteArray);
    inflate.end();
    try {
      inflate.reset();
      inflate.setInput(byteArray);
    } catch (NullPointerException e) {
      r = 1;
View Full Code Here

      r = 1;
    }
    assertEquals("inflate can still be used after end is called", 1, r);

    Inflater i = new Inflater();
    i.end();
    // check for exception
    i.end();
  }

  /**
 
View Full Code Here

    assertEquals("inflate can still be used after end is called", 1, r);

    Inflater i = new Inflater();
    i.end();
    // check for exception
    i.end();
  }

  /**
   * @tests java.util.zip.Inflater#finished()
   */
 
View Full Code Here

                        if (decompressor.finished())
                            break;
                    }

                    decompressor.end();

                    queryString = new String(decompressed.getData(), 0, decompressed.size(), "UTF-8");
                    break;
                case NONE:
                    try
View Full Code Here

                final Inflater inflater = new Inflater(true);
                return new InflaterInputStream(bis, inflater) {
                    @Override
                    public void close() throws IOException {
                        super.close();
                        inflater.end();
                    }
                };
            default:
                throw new ZipException("Found unsupported compression method "
                                       + ze.getMethod());
View Full Code Here

                        if (decompressor.finished())
                            break;
                    }

                    decompressor.end();

                    queryString = new String(decompressed.getData(), 0, decompressed.size(), "UTF-8");
                    break;
                case NONE:
                    try
View Full Code Here

                throw new DataFormatException(len + " " + outLen);
            }
        } catch (DataFormatException e) {
            throw DbException.get(ErrorCode.COMPRESSION_ERROR, e);
        }
        decompresser.end();
    }

}
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.