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


                        if (decompressor.finished())
                            break;
                    }

                    decompressor.end();

                    queryString = new String(decompressed.getData(), 0, decompressed.size(), "UTF-8");
                    break;
                case NONE:
                    try
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

                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 (length != blockSize) {
                                throw new ShortFileException();
                            }

                            inflator.end();
                        } catch (DataFormatException e) {
                            throw new DumpArchiveException("bad data", e);
                        }

                        break;
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

        Inflater decompressor = new Inflater();
        byte[] compressed = strip( bytes );
        decompressor.setInput( compressed );   // feed the Inflater the bytes
        byte[] buffer = new byte[ 56 ];
        int count = decompressor.inflate( buffer );   // decompress the data into the buffer
        decompressor.end();
       
        //create an array to hold the header and body bytes
        byte[] swf = new byte[ 8 + count ];
        //copy the first 8 bytes which are uncompressed into the swf array
        System.arraycopy( bytes, 0, swf, 0, 8 );
View Full Code Here

      {
        throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), ioe);
      }
      finally
      {
        decompressor.end();      
      }
    }

    private void _zipToBytes(FacesContext context, Object state)
    {
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

        // this will happen if the field is not compressed
        throw new IOException ("field data are in wrong format: " + e.toString());
      }
    }
 
    decompressor.end();
   
    // Get the decompressed data
    return bos.toByteArray();
  }
}
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.