Exemplo n.º 1
0
        static void Main()
        {
            String outFilename = "c:/temp/outfile.gzip";
            java.util.zip.GZIPOutputStream outJ = new java.util.zip.GZIPOutputStream(new java.io.FileOutputStream(outFilename));

            String inFilename = "c:/README.txt";
            java.io.FileInputStream inJ = new java.io.FileInputStream(inFilename);

            byte[] buf = new byte[1024];
            int len;
            while ((len = inJ.read(buf)) > 0)
            {
                outJ.write(buf, 0, len);
            }
            inJ.close();

            outJ.finish();
            outJ.close();
        }
        static void Main()
        {
            String outFilename = "c:/temp/outfile.gzip";

            java.util.zip.GZIPOutputStream outJ = new java.util.zip.GZIPOutputStream(new java.io.FileOutputStream(outFilename));

            String inFilename = "c:/README.txt";

            java.io.FileInputStream inJ = new java.io.FileInputStream(inFilename);

            byte[] buf = new byte[1024];
            int    len;

            while ((len = inJ.read(buf)) > 0)
            {
                outJ.write(buf, 0, len);
            }
            inJ.close();

            outJ.finish();
            outJ.close();
        }
 /** {@inheritDoc} */
 public override void write(int b)// throws IOException
 {
     outJ.write(b);
 }