Package org.apache.tools.bzip2

Examples of org.apache.tools.bzip2.CBZip2InputStream


     */
    protected OutputStream wrapStream(OutputStream out) throws IOException {
        for (int i = 0; i < MAGIC.length; i++) {
            out.write(MAGIC[i]);
        }
        return new CBZip2OutputStream(out);
    }
View Full Code Here


                return new GZIPOutputStream(ostream);
            } else {
                if (BZIP2.equals(v)) {
                    ostream.write('B');
                    ostream.write('Z');
                    return new CBZip2OutputStream(ostream);
                }
            }
            return ostream;
        }
View Full Code Here

    public double d2(String x, String y) {
        String str = x + y;
        double result = 0.0f;
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream(str.length());
            CBZip2OutputStream os = new CBZip2OutputStream(baos);
            os.write(str.getBytes());
            os.close();
            baos.close();
            result = baos.toByteArray().length;
        } catch (IOException e) {
            e.printStackTrace();
        }
View Full Code Here

                return new GZIPOutputStream(ostream);
            } else {
                if (BZIP2.equals(v)) {
                    ostream.write('B');
                    ostream.write('Z');
                    return new CBZip2OutputStream(ostream);
                }
            }
            return ostream;
        }
View Full Code Here

* @ant.task category="packaging"
*/

public class BZip2 extends Pack {
    protected void pack() {
        CBZip2OutputStream zOut = null;
        try {
            BufferedOutputStream bos =
                new BufferedOutputStream(new FileOutputStream(zipFile));
            bos.write('B');
            bos.write('Z');
            zOut = new CBZip2OutputStream(bos);
            zipFile(source, zOut);
        } catch (IOException ioe) {
            String msg = "Problem creating bzip2 " + ioe.getMessage();
            throw new BuildException(msg, ioe, getLocation());
        } finally {
            if (zOut != null) {
                try {
                    // close up
                    zOut.close();
                } catch (IOException e) {
                    //ignore
                }
            }
        }
View Full Code Here

                return new GZIPOutputStream(ostream);
            } else {
                if (BZIP2.equals(value)) {
                    ostream.write('B');
                    ostream.write('Z');
                    return new CBZip2OutputStream(ostream);
                }
            }
            return ostream;
        }
View Full Code Here

                return new GZIPOutputStream(ostream);
            } else {
                if (BZIP2.equals(v)) {
                    ostream.write('B');
                    ostream.write('Z');
                    return new CBZip2OutputStream(ostream);
                }
            }
            return ostream;
        }
View Full Code Here

            // def.setLevel(Deflater.BEST_COMPRESSION);
          }
        };
        break;
      case BZIP2:
        gzipOS = new CBZip2OutputStream(countOS);
        break;
      default:
        throw new RuntimeException("Unsupported compression: " + compressor);
      }
View Full Code Here

public class BZip2 extends Pack {
    /**
     * Compress the zipFile.
     */
    protected void pack() {
        CBZip2OutputStream zOut = null;
        try {
            BufferedOutputStream bos =
                new BufferedOutputStream(new FileOutputStream(zipFile));
            bos.write('B');
            bos.write('Z');
            zOut = new CBZip2OutputStream(bos);
            zipResource(getSrcResource(), zOut);
        } catch (IOException ioe) {
            String msg = "Problem creating bzip2 " + ioe.getMessage();
            throw new BuildException(msg, ioe, getLocation());
        } finally {
View Full Code Here

     */
    protected OutputStream wrapStream(OutputStream out) throws IOException {
        for (int i = 0; i < MAGIC.length; i++) {
            out.write(MAGIC[i]);
        }
        return new CBZip2OutputStream(out);
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.bzip2.CBZip2InputStream

Copyright © 2018 www.massapicom. 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.