Deputy of gzip

Hi all

No replacement for gzip...

Thank you...

For what?

I recommend anywhere that you can use GZIP.  If there is a problem when you use GZIP, I suspect that the problem lies in the way he uses, not GZIP itself.

Tags: BlackBerry Developers

Similar Questions

  • Gzip encoding does not work

    For some reason, there are a few problems with the encoding of internet files which does not not specific files.

    some research more told me there is a problem with gzip encoding (I'm not sure that all deflate). Decompression doesn't seem to work.

    Below you can see the result a website (http://vagrantcloud.com) where the CSS file failed to load. Obviously, no tag.
    http://imgur.com/dPuv2S7

    If you need more information about this issue, don't think and just ask in the comments.
    I hope this will be fixed soon.

    Looks like a problem of specific site. I use many sites like vagrantcloud and vagabond as sysadmin. It seems that the server (or CMS-system) does not work well with the application of pipeline. For this reason, the generated files (CSS or JS) are not completely generated when the HTML is sent through. This could be the reason why I had the problem that with the CSS which was not able to load (JS is almost never generated by a server)

    @jscher2000 I think the sign of mixed content is also resolved by turning off the pipeline processing.

  • Is it possible to apply a compression as gzip with the web server of labview?

    I am currently implementing a web page will be provided by the NOR sbRIO 9636.  I was able to get the html, css and js served very well.  I'm curious to know if there is a way to implement gzip compression to help with page load times?

    OK, a few points:

    1. I heard that he discussed that you can theoretically install a Web server on the Linux based cRIO. But there's a great big disadvantage: I've never done or spoken to someone who did it I don't know how it actually works.
    2. Given the cheap price of the hardware of today a safer alternative would be to include a separate computer, whose only function is to host the web interface. There are many small computers that would be ideal for this application - which many were initially designed for use in home theater applications.

    The point of my post was that there are some limitations in the LV Web server you have to find your way around.

    Mike...

  • GZIP-problem for the Turkish language

    Hi all
    I am using gzip content-encoding and accept-encoding in properties. For the language Turkish gzip does not work very well it shows like EMC Akkua? Â?, HA? A¼seyin to? Â? random? A±A? Â? Kan. How to perform correctly.

    Thank you...

    Just saw your second message.

    I suspect that your problem is in unzipResponse - try this code instead.  Furthermore, I just wrote this, not compiled or tested, I hope you get the idea and can correct any errors you find.

    public String unzipResponse (io InputStream) throws Exception {}
    String returnString = "";
    try {}
    Gz GZIPInputStream = new GZIPInputStream (io);
    ubyte [] bytes = IOUtilities.streamToBytes (gz);
    returnString = new String(bytes,"UTF-8");
    }
    catch (Exception ex) {}
    Dialog.Alert ("unzipResponse:" + ex.getMessage ());
    }
    Return returnString;
    }

  • Problems with GZip & FTP

    Hello

    in my application, I need to send a file compressed using ftp.

    To do this, I used a class initially write to use with J2SE (SimpleFTP)

    I have change for use with RIM API and it work with file bit compressed (like 4 KB) but when I try to send one just a little big (12Ko) I have a problem to decompress: gzip - me to say end of file unexpected.

    It is a bit of cod used:

    //In a thread i create the connection and change to BIN
    ftp.connect(ip, port, user, psw, true, apn, apnUser, apnPsw);
    ftp.cwd(dir);
    ftp.bin();
    
    //here I obtain a csv representation of my object and store it in a //String var
    String csv = r.toCSV();
    
    //this method ask to ftp object to store a ByteArray in the file named //file and i want to zip it and return true if all is ok
    if (ftp.stor(new ByteArrayInputStream(csv.getBytes("UTF-8")),file,true))
    //...do things
    

    the method of object ftp stor have this code:

    /**
     * Sends a file to be stored on the FTP server. Returns true if the file
     * transfer was successful. The file is sent in passive mode to avoid NAT or
     * firewall problems at the client end.
     */
    public synchronized boolean stor(InputStream inputStream, String filename, boolean zipped) throws IOException {
    
        sendLine("PASV");
        String response = readLine();
        if (!response.startsWith("227 ")) {
            throw new IOException("SimpleFTP could not request passive mode: " + response);
        }
        String ip = null;
        int port = -1;
        int opening = response.indexOf('(');
        int closing = response.indexOf(')', opening + 1);
        if (closing > 0) {
            String dataLink = response.substring(opening + 1, closing);
            String[] tokenizer = Functions.splitString(dataLink, ',', -1);
            try {
                ip = tokenizer[0] + "." + tokenizer[1] + "." + tokenizer[2] + "." + tokenizer[3];
                port = Integer.parseInt(tokenizer[4]) * 256 + Integer.parseInt(tokenizer[5]);
            } catch (Exception e) {
                throw new IOException("SimpleFTP received bad data link information: " + response);
            }
        }
        String url = "socket://" + ip + ":" + port + urlParam;
        Logger.log(this, "Try to open passive connection to "+url);
        SocketConnection dataSocket = (SocketConnection) Connector.open(url);
        dataSocket.setSocketOption(SocketConnection.LINGER, 5);
        dataSocket.setSocketOption(SocketConnection.DELAY, 5);
    
        sendLine("STOR " + filename);
    
        response = readLine();
        if (!response.startsWith("125 ")&&!response.startsWith("150 ")) {
            dataSocket.close();
            dataSocket=null;
            throw new IOException("SimpleFTP was not allowed to send the file: " + response);
        }
        Logger.log(this, "Connected to "+url);
    
        OutputStream output;
        if (zipped)
            output = new GZIPOutputStream(dataSocket.openOutputStream(),GZIPOutputStream.COMPRESSION_BEST);
        else
            output = dataSocket.openOutputStream();
    
        byte[] buffer = new byte[512];
        int bytesRead = 0;
    
        while ((bytesRead = inputStream.read(buffer)) != -1) {
            output.write(buffer, 0, bytesRead);
        }
    
        output.flush();
        output.close();
        output = null;
        dataSocket.close();
        dataSocket=null;
    
        response = readLine();
        return response.startsWith("226 ");
    }
    

    The readline() and sendline("") methods read or write to the ftp decision-making, a line ended with CR and I so need to send FTP commands

    I think that everything is ok, for this problem I find in a forum that the problem will be the use of ASCII in FTP method, but I change to BIN

    Any idea?

    Thank you in advance!

    Hello

    Finally, I solved the problem.

    I find the solution in the documentation GZIPOutputStream

    You must pass OutputStream to GZIPOutputStream, zipping it and then you must close GZIPOutputStream but you must use the original OutputStream.

    So in my SimpleFTP class I have to write about gzip, close it then flush() and close() the original outputstream.

    Knit

    I had the new method of stor() here to see

    /**
         * Sends a file to be stored on the FTP server. Returns true if the file
         * transfer was successful. The file is sent in passive mode to avoid NAT or
         * firewall problems at the client end.
         */
        public synchronized boolean stor(InputStream inputStream, String filename, boolean zipped) throws IOException {
    
            sendLine("PASV");
            String response = readLine();
            if (!response.startsWith("227 ")) {
                throw new IOException("SimpleFTP could not request passive mode: " + response);
            }
    
            String ip = null;
            int port = -1;
            int opening = response.indexOf('(');
            int closing = response.indexOf(')', opening + 1);
            if (closing > 0) {
                String dataLink = response.substring(opening + 1, closing);
                String[] tokenizer = Functions.splitString(dataLink, ',', -1);
                try {
                    ip = tokenizer[0] + "." + tokenizer[1] + "." + tokenizer[2] + "." + tokenizer[3];
                    port = Integer.parseInt(tokenizer[4]) * 256 + Integer.parseInt(tokenizer[5]);
                } catch (Exception e) {
                    throw new IOException("SimpleFTP received bad data link information: " + response);
                }
            }
            String url = "socket://" + ip + ":" + port + urlParam;
            Logger.log(this, "Try to open passive connection to "+url);
            SocketConnection dataSocket = (SocketConnection) Connector.open(url);
            dataSocket.setSocketOption(SocketConnection.LINGER, 5);
            dataSocket.setSocketOption(SocketConnection.DELAY, 5);
    
            sendLine("STOR " + filename);
    
            response = readLine();
            if (!response.startsWith("125 ")&&!response.startsWith("150 ")) {
                dataSocket.close();
                dataSocket=null;
                throw new IOException("SimpleFTP was not allowed to send the file: " + response);
            }
            Logger.log(this, "Connected to "+url);
    
            OutputStream output = dataSocket.openOutputStream();
            byte[] buffer = new byte[512];
            int bytesRead = 0;
    
            if (zipped){
                GZIPOutputStream zipOutput = new GZIPOutputStream(output,6, GZIPOutputStream.MAX_LOG2_WINDOW_LENGTH);;
                while (!isAskForAbort() && (bytesRead = inputStream.read(buffer)) != -1) {
                    zipOutput.write(buffer, 0, bytesRead);
                }
                zipOutput.close();
            } else {
                while (!isAskForAbort() && (bytesRead = inputStream.read(buffer)) != -1) {
                    output.write(buffer, 0, bytesRead);
                }
            }
            if (isAskForAbort()){
                abor();
                output.close();
                output = null;
                dataSocket.close();
                dataSocket=null;
                try {
                    setAskForAbort(false);
                } catch (BbException e) {/*nothing to do. Here ftp is conected*/}
                return false;
            }
            output.flush();
            output.close();
            output = null;
            dataSocket.close();
            dataSocket=null;
    
            response = readLine();
            return response.startsWith("226 ");
        }
    

    Thank you much for the help.

  • Gzip request to the web application server Java

    Hi experts,

    My first post here.

    I am building a Java for Blackberry application that needs to send data relatively large (in the hundreds of kb/s) on a web server.

    Since the mobile internet connection is not fast enough transfer a lot of data will take a lot of time.

    Question is, how can I compress data with gzip and handle it on my web server.

    Currently, I have

    String data = "a=b&c=d";
    OutputStream outputStream = httpConnection.openOutputStream();
    outputStream.write(data.getBytes());
    outputStream.flush();
    

    I'm guessing that blindly that I need to do something like

    GZIPOutputStream gzipOutputStream = (GZIPOutputStream) httpConnection.openOutputStream();
    gzipOutputStream.write(data.getBytes());
    gzipOutputStream.flush();
    

    Is this correct? Moreover, how should I handle it on my Web server?

    Would my server Web decompress this data automatically, so I can just get the values of the parameters a and c normally?

    Can I send different Content-Type?

    Please notify. Thanks in advance.

    As shown rcmaniac25, you must wrap the output stream you get from the connection inside a GZIPOutputStream new object. For any compression, however, you must also specify the compression level.

    As to whether the data will be decompressed on the side server depends on the server. At a minimum, you must set the content-encoding property for the connection before the display of the data. I highly recommend adjustment of the length of the content; to do this, write the data compressed in a buffer of bytes. I also suggest setting a user-agent header, because some servers incorrectly claims that come without one. Finally, I suggest you add a header x-rim-transcode-content with the value 'none' from the data is not intended for a browser. (The server must also affect this header in the response.) This is particularly important if through MDS or BIS.

    Put them all together, it might look like this:

    String data = "a=b&c=d";NoCopyByteArrayOutputStream bos = new NoCopyByteArrayOutputStream();GZIPOutputStream gos = new GZIPOutputStream(bos, GZIPOutputStream.COMPRESSION_BEST);gos.write(data.getBytes());gos.close();int len = bos.size();// unqualified constants below are available if your class// implements net.rim.device.api.io.http.HttpProtocolConstantshttpConnection.setRequestMethod(HTTP_METHOD_POST);httpConnection.setRequestProperty(HEADER_USER_AGENT, "MyUserAgent");httpConnection.setRequestProperty("x-rim-transcode-content", "none");httpConnection.setRequestProperty(HEADER_CONTENT_TYPE,    CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);httpConnection.setRequestProperty(HEADER_CONTENT_ENCODING, "gzip");httpConnection.setRequestProperty(HEADER_CONTENT_LENGTH,    Integer.toString(len));OutputStream os = httpConnection.openOutputStream();os.write(bos.getByteArray(), 0, len);os.close();
    

    If you post something in addition to the url-encoded name-value pairs, of course, you must use the appropriate content-type header value.

    I think (although I've never tried) that Apache will honour the content-encoding header on poles, condition mod_gzip is turned on (which it usually is). Most of the other web servers (Microsoft IIS, Sun Java Web Server, Nginx, etc) also support HTTP compression.

    I suggest you to test this with a simple script that simply takes your POST data. If it resonates as expected, you're good to go (but see below).

    If the server does not automatically unzip the application, then you will manage all script processed the MESSAGE. PHP, Perl, Ruby, etc. all are excellent tools to treat the gzip data. You'll just have to deal with parsing the url-encoded name-value pairs explicitly. But there are great tools in all these languages for that, too.

    Be aware that there may be limits to the amount of data that you can POST in a single application. You may need to consider dropping your messages in blocks of manageable data.

  • Gzip analyzes XML

    I've seen posts about issues with extracting XML and gzip. Separately, I have no problem doing either. But I can't send a gzipinputstream to my xml parser - he just throws exception and told me no stack trace.

    I send a parameter in my http request that determines if the server should return an XML file or the gziped XML file.  When you ask gzip, I can read and analyze very well. If I ask gzip and just read steam like this...

                    byte[] data = new byte[256];
                    int len = 0;
                    int size = 0;
                    StringBuffer raw = new StringBuffer();
    
                    while ( -1 != (len = inputStream.read(data)) )
                    {
                        raw.append(new String(data, 0, len));
                        size += len;
                    }
    

    It prints like my xml... so I guess that means his power to receive the data very gzip.

    However, if I ask gzip and try to analyze using the same code that works when I just parse xml, it fails.  Is there another step I have to do to convert the inputstream so Manager xml can be read?

    httpConnection = (HttpConnection)Connector.open(url);
    inputStream = httpConnection.openDataInputStream();
    
    if(httpConnection.getResponseCode() == HttpConnection.HTTP_OK)
    {
    
        inputStream = new GZIPInputStream(inputStream);
        InputSource is = new InputSource(inputStream);
    
        is.setEncoding(desiredEncoding);
    
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser parser = factory.newSAXParser();
    
        DefaultHandler hcHandler = new XMLParse();
    
        parser.parse(is,hcHandler);
    
    } //end if(httpConnection.getResponseCode() == HttpConnection.HTTP_OK)
    

    You should check to see if the content is gzip:

    String encoding = m_httpConnection.getHeaderField("Content-Encoding");
    If ((encodage! = null) & (encoding.indexOf ("gzip")! = - 1)) {}
    compressed = true;
    }

    Then, unzip it:

    If {(compressed)
    Gzip GZIPInputStream = new GZIPInputStream (dataInputStream);
    DataInputStream tmp = new DataInputStream (gzip);
    dataInputStream = tmp;
    }

    Now you can safely parse the XML code.

  • Compress and decompress data using GZip

    Hello

    I compress and decompress data on Blackberry 8100 device using the GZip algorithm.

    I use following code:

    try {           GZIPOutputStream gCompress = null;          try {               ByteArrayOutputStream compressByte = new ByteArrayOutputStream();               gCompress = new GZIPOutputStream(compressByte,9);               gCompress.write(inputstring.getBytes());                                                //gCompress.flush();                compressedBytes = compressByte.toByteArray();               System.out.println("compressedBytes : "                     + new String(compressedBytes));             compressedString = new String(compressedBytes);                         } catch (IOException ex) {              ex.printStackTrace();           }       } catch (Exception e) {         e.printStackTrace();        }
    

    The server is unable to decompress data.

    Help, please.

    Thank you very much.

    I think you do a byte to the conversion of the string which you should not do and which may be screwing up your data.  The output of compression is not likely to be easily represented by Unicode characters and you want to transmit the bytes, so I think that is not necessary.

    This is a reformulated version of the sample in the API, which seems inaccurate, in any case: give it a try and remember that you can send the bytes, not characters.

    public static byte[] compress( byte[] data ) {
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            GZIPOutputStream gzipStream = new GZIPOutputStream( baos,
                                                                GZIPOutputStream.COMPRESSION_BEST,
                                                                GZIPOutputStream.MAX_LOG2_WINDOW_LENGTH );
            gzipStream.write( data );
            gzipStream.close();
            return baos.toByteArray();
        }
        catch(IOException ioe) {
            return null;
        }
    }
    
  • Connector.Open fails to open the gzip on multiple devices

    Hello

    I am developing application using JDE 5.0.0 and installed on the device with OS above 5.0.0. The code below crashes only on some devices.

    ss.lblStatus.setText ("loading data...");   This text displayed
    C HttpConnection = null;
    DataInputStream in = null;
        
    int rc;
    try {}
    String RCS = URL_HOME + "DATA. BIN.gzip"+ sConnection;
    c = (HttpConnection), Connector.open (SNA);
    ss.lblStatus.setText ("Conn opened...");   This text is displayed not, assuming that Connector.open fails
    in = c.openDataInputStream () (DataInputStream);
    ss.lblStatus.setText ("SAY open...");
    GZIPInputStream gzipInputStream = null;
    gzipInputStream = new GZIPInputStream (in);
    ss.lblStatus.setText ("GZIP in...");
    Byte [] buf = new byte [4096];
        
    int len;
    long lTotalLen = 0;
    While ((len = gzipInputStream.read (buf, 0, 4096)) > 0) {}
    out. Write (buf, 0, len);
    ubyte [] buffer = new byte [len];
    for (int i = 0; i)< len;="" i++)="">
    buffer [i] = buf [i];
    }
    lTotalLen = lTotalLen + len;
    ss.lblStatus.setText ("Loading... ("' +(lTotalLen/1024) + ' KB ');
    surlabasedesdonneesdufabricantduballast = surlabasedesdonneesdufabricantduballast + String (buffer) new;
    }
    gzipInputStream.close ();
    in. Close();
    } catch (Exception e) {}
    throw new IllegalArgumentException ("Internet problem");
    } {Finally
    If (in! = null) {}
    in. Close();
    }
    If (c! = null) {}
    c.Close ();
    }
    }
        
    No idea why?

    Thanks in advance.

    Kind regards

    Ivan

    Hello

    I tried everything and still does not work. It took me days to realize that the problem was not on the stream. I update a label of a different thread, which causes blocking. Problem solved.

    Thanks anyway.

    Kind regards
    Ivan

  • Is there one GUI, other than Assistant Deputy Ministers, and the CSM for test site vpn to ipsec tunnels on an asa5505/asa5510?

    Is there a GUI, other than the Assistant Deputy Ministers and the Security Manager cisco IPSec of Cisco ASA5505/5510 test site to vpn tunnels. I usually go through the steps listed in here in the link below in the terminal window, but it sucks when you have several tunnels to keep abreast of.

    http://www.nwdump.com/troubleshooting-IPSec-VPN-on-ASA/

    I would have preferred one that works with Freebsd or LInux, as the cisco security manager CSM v4.1 is limited to only current running on windows server 2008 ent.

    Thank you

    Jason

    No, for troubleshooting the best way is to use the CLI that will give you debug output on where it is lacking.

    For configuration, outside the CLI, ASDM and CSM, unfortunately there is no other tool that works on Linux/Freebsd because it is more specific orders of the ASA and only limited to the CLI, ASDM, or CSM.

  • GZIP for Adobe Muse

    I heard of GZIP for mobile versions. How to incorporate cela in my sites of Muse, and does it matter?

    Hello GrahamBedbrook,

    Please go through this post - made Adobe Muse support GZIP compression for more information about this query.

    Kind regards

    Ankush

  • Deputy of security does not

    I have a HP Pavilion dv6 Windows 7 Home Premium 64-bit Service Pack 1.  I upgraded to IE 10 and not my HP Security Office Assistant isn't automatically signing me in sites that I put in place to do so.  Windows remind password is either not arise.  How can I activate Deputy Security back?

    Follow the steps described by the Dragon green expertise-fur in this link to uninstall and reinstall the latest version of the software SimplePass.

  • Google Page Speed / activation of the gzip compression

    Hi all
    Google analytic generating warnings on my site about the speed of the page. He recommends:

    gzip compression.

    Resources with gzip or deflate compression can reduce the number of bytes sent over the network.

    All modern browsers support and negotiate automatically gzip compression for all HTTP requests. Activation gzip compression can reduce the size of the answer transferred up to 90%, which can significantly reduce the amount of time to download resources, reduce the use of data for the customer and improve first your pages render time.


    Leverage browser caching

    Set an expiration date or an age limit in the HTTP headers for static resources tells the browser to load the previously downloaded resources to local disk, rather than on the network.


    Minify CSS

    Compaction of CSS code can record the number of bytes of data and speed up the download and analyze time.



    I followed all the SEO best practices from inside the Muse and according to google, my site is a 80/100 for page speed on mobile and 73/100 desktop. With a total of 96/100 user experience rating on mobile.

    Can someone give me advice on how to improve and fix these warnings from inside Adobe Muse?

    Thanks in advance,
    Robbie.

    There is nothing to change. Unless you care to clean up bloated CSS of Muse, after publishing the files and merge them several redundant styles, is nothing, that you can change. And compression has nothing to do with Muse, either. It's a side thing server as it is to define headers of files and their dates.

    Mylenium

  • compression gzip http vCOPs

    Hello

    vCOPs generates a lot of http (s) traffic, we want to enable gzip compression save bandwidth.

    On the device it run tomcat and apache2 demons. I guess that apache2 is proxy for tomcat.

    It is: what is recommended to enable gzip compression in vCOPs env? Should it be enabled on tomcat or apache?

    It is not recommended to enable gzip compression, if it is disabled OOTB. It would be unsupported. They run Linux + tomcat, etc, but they should be treated as owners of devices and managed/administered within our support guidelines.

    You said that there are a lot of http traffic. Is that the customer traffic, or collection of adapter to vCenter + other sources?

    Your users use vSphere UI or the custom of dashboards? HTTP traffic should not be so likely to cause a problem and I actually never heard of it as a complaint. It is possible that you are using customized dashboards that times of refreshing interval, which would result in HTTP traffic some more high due to the updating of content, but it would be a much less important problem compared to more load exerted on the VMS UI/analytical...

  • I have PS CC 2014 and 7.3 of Extension Manager installed, but not all extensions appear in PS. All are enabled and up to date versions. For example, Adobe watercolor Deputy. Any suggestions?

    I have PS CC 2014 and 7.3 of Extension Manager installed, but not all extensions appear in PS. All are enabled and up to date versions. For example, Adobe watercolor Deputy. Any suggestions?

    Please see the compatibility on each module table because not all will be compatible with PS CC 2014 and therefore do not list in the extensions under this version of PS Manager.

Maybe you are looking for