Package java.util.zip

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


                        bytes++;
                    }
                    byte colorset;
                    byte[] row = new byte[bytes];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < bytes; x++) {
                            colorset = row[x];
                            for (int sh = 0; sh < 8; sh++) {
                                if(x * 8 + sh >= width) {
View Full Code Here


                    }
                    byte colorset;
                    byte[] row = new byte[bytes];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < bytes; x++) {
                            colorset = row[x];
                            for (int sh = 0; sh < 8; sh++) {
                                if(x * 8 + sh >= width) {
                                    break;
View Full Code Here

                break;
            case PNGSaver.GREYSCALE_MODE:
                {
                    byte[] row = new byte[width];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < width; x++) {
                            colors[0] = row[x];
                            colors[1] = colors[0];
                            colors[2] = colors[0];
View Full Code Here

            case PNGSaver.GREYSCALE_MODE:
                {
                    byte[] row = new byte[width];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < width; x++) {
                            colors[0] = row[x];
                            colors[1] = colors[0];
                            colors[2] = colors[0];
                            setColors(result, x, y, colors);
View Full Code Here

                break;
            case PNGSaver.COLOR_MODE:
                {
                    byte[] row = new byte[width * 3];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < width; x++) {
                            colors[0] = (row[x * 3 + 0]&0xff);
                            colors[1] = (row[x * 3 + 1]&0xff);
                            colors[2] = (row[x * 3 + 2]&0xff);
View Full Code Here

            case PNGSaver.COLOR_MODE:
                {
                    byte[] row = new byte[width * 3];
                    for (int y = 0; y < height; y++) {
                        inflater.inflate(new byte[1]);
                        inflater.inflate(row);
                        for (int x = 0; x < width; x++) {
                            colors[0] = (row[x * 3 + 0]&0xff);
                            colors[1] = (row[x * 3 + 1]&0xff);
                            colors[2] = (row[x * 3 + 2]&0xff);
                            setColors(result, x, y, colors);
View Full Code Here

        inflater.setInput(compressedData);
        ByteArrayOutputStream bos = new ByteArrayOutputStream(compressedData.length);
        byte[] buf = new byte[1024];
        while (!inflater.finished()) {
            try {
                int count = inflater.inflate(buf);
                bos.write(buf, 0, count);
            } catch (DataFormatException e) {
            }
        }
        bos.close();
View Full Code Here

        Inflater inflater = new Inflater();
        inflater.setInput(compressedData);
        byte[] buf = new byte[1024];
        while (!inflater.finished()) {
            try {
                int count = inflater.inflate(buf);
                out.write(buf, 0, count);
            } catch (DataFormatException e) {
                throw new IOException(e);
            }
        }
View Full Code Here

          int len = ((compressed[0] << 0) & 0x000000FF)
              | ((compressed[1] << 8) & 0x0000FF00)
              | ((compressed[2] << 16) & 0x00FF0000)
              | ((compressed[3] << 24) & 0xFF000000);
          byte[] uncompressed = new byte[len];
          zip.inflate(uncompressed);
          saveFile(name + ".tmp2.bin", uncompressed);
        } catch (Exception e) {
          System.out.println("Failed to inflate .tmp1.bin file: "
              + e.toString());
        }
View Full Code Here

      Inflater i = new Inflater();
      i.setInput(data, 1, data.length-1);

      byte[] out = new byte[out_size];
      try {
        int j = i.inflate(out);
        if(j != out_size)
          throw new IOException("Invalid out size " + j + " expecting " + out_size);
        if(!i.finished())
          throw new IOException("Unfinished");
      } catch (DataFormatException e) {
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.