Examples of GZIPInputStream


Examples of java.util.zip.GZIPInputStream

    String contentEncoding = serverResponse.getHeaderField(HttpConstants.HDR_CONTENT_ENCODING);
    serverIn = serverResponse.getInputStream();

    if ("gzip".equals(contentEncoding)) {
      serverIn = new GZIPInputStream(serverIn);
    } else if ("identity".equals(contentEncoding) || contentEncoding == null) {
      // Plain
    } else {
      throw new Exception("Invalid content encoding " + serverResponse.getHeaderField(HttpConstants.HDR_CONTENT_ENCODING));
    }
View Full Code Here

Examples of java.util.zip.GZIPInputStream

    private static InputStream prepareBody(final RequestHeader header, final InputStream in) throws IOException {
        InputStream body = in;
        // data may be compressed
        final String bodyEncoding = header.get(HeaderFramework.CONTENT_ENCODING);
        if(HeaderFramework.CONTENT_ENCODING_GZIP.equalsIgnoreCase(bodyEncoding) && !(body instanceof GZIPInputStream)) {
            body = new GZIPInputStream(body);
            // length of uncompressed data is unknown
            header.remove(HeaderFramework.CONTENT_LENGTH);
        } else {
            // ensure the end of data (if client keeps alive the connection)
            final long clength = header.getContentLength();
View Full Code Here

Examples of net.rim.device.api.compress.GZIPInputStream

        if( !bCompressed ) {
            return data;
        }

        GZIPInputStream gin = new GZIPInputStream( new ByteArrayInputStream( data ) );
        return IOUtilities.streamToBytes( gin ); // Return original data, or null
    }
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.