public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/19109] New: Creating archives with java.util.zip
@ 2004-12-21 14:42 wayne dot gray at coynetextileservices dot com
  2004-12-21 14:48 ` [Bug libgcj/19109] " belyshev at lubercy dot com
  2004-12-21 15:48 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: wayne dot gray at coynetextileservices dot com @ 2004-12-21 14:42 UTC (permalink / raw)
  To: gcc-bugs

The below code produces a zip file that can be opened in WinZip 8.1 when
compiled with Sun JRE 1.4.1_01.  When compiled with GCJ 3.4.0 the zip file is
produced but WinZip says it's corrupt.

Is this a bug in GCJ or am I misunderstanding how java.util.zip works in libgcj?

Thanks.

Usage:  Pass in two arguments to class.  First arg is name of archive and second
is the name of the file you want to add to the archive.

************************************************************************

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

public class ZipMain {

	/**
	 * 
	 */
	public ZipMain() {
		super();
	}

	public static void main(String[] args) {
	
		String sArchive = args[0];
		String sFile = args[1];
		
		if (sArchive==null || sFile==null || 
				sArchive.length()==0 || sFile.length()==0){
			return;
		}
		
		File f = new File(sFile);
		
		if (!f.exists()){
			return;
		}
		
		ZipOutputStream oArchive = null;
		File fArchive = new File(sArchive);

		try {
			//open archive
			oArchive = new ZipOutputStream(new FileOutputStream(fArchive));
				oArchive.setLevel(Deflater.DEFAULT_COMPRESSION);
			
				//add file
				
			ZipEntry zipEntry = new ZipEntry(f.toString());
			FileInputStream fin = new FileInputStream(f);
			BufferedInputStream in = new BufferedInputStream(fin);
			oArchive.putNextEntry(zipEntry);

			byte[] buf = new byte[1024];
			int len;
			while ((len = in.read(buf)) >= 0) {
				oArchive.write(buf, 0, len);
			}
			
			//clean up
			in.close();
			oArchive.closeEntry();
			oArchive.close();
			
		} catch (Exception e){
			e.printStackTrace();
		}
		
	}
}

-- 
           Summary: Creating archives with java.util.zip
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wayne dot gray at coynetextileservices dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19109


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/19109] Creating archives with java.util.zip
  2004-12-21 14:42 [Bug libgcj/19109] New: Creating archives with java.util.zip wayne dot gray at coynetextileservices dot com
@ 2004-12-21 14:48 ` belyshev at lubercy dot com
  2004-12-21 15:48 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: belyshev at lubercy dot com @ 2004-12-21 14:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at lubercy dot com  2004-12-21 14:48 -------
It works for me with mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to work|                            |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19109


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/19109] Creating archives with java.util.zip
  2004-12-21 14:42 [Bug libgcj/19109] New: Creating archives with java.util.zip wayne dot gray at coynetextileservices dot com
  2004-12-21 14:48 ` [Bug libgcj/19109] " belyshev at lubercy dot com
@ 2004-12-21 15:48 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-21 15:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-21 15:48 -------
Fixed on the mainline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19109


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/19109] Creating archives with java.util.zip
       [not found] <bug-19109-4@http.gcc.gnu.org/bugzilla/>
@ 2015-10-20 16:30 ` hjl at gcc dot gnu.org
  0 siblings, 0 replies; 4+ messages in thread
From: hjl at gcc dot gnu.org @ 2015-10-20 16:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19109

--- Comment #3 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Tue Oct 20 16:29:28 2015
New Revision: 229088

URL: https://gcc.gnu.org/viewcvs?rev=229088&root=gcc&view=rev
Log:
Add --enable-compressed-debug-sections={all,gas,gold,ld}

This patch removes the gas configure option:

--enable-compressed-debug-sections

and adds a toplevel configure option:

--enable-compressed-debug-sections={all,gas,gold,ld}

to enable compressed debug sections for gas, gold or ld by default.  At
the moment, this configure option is ignored by gold and ld.  For x86
Linux targets, default to compressing debug sections in gas.

        Sync with binutils-gdb:
        PR gas/19109
        * configure.ac: Add
        --enable-compressed-debug-sections={all,gas,gold,ld}.
        * configure: Regenerated.

Modified:
    trunk/ChangeLog
    trunk/configure
    trunk/configure.ac


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-20 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21 14:42 [Bug libgcj/19109] New: Creating archives with java.util.zip wayne dot gray at coynetextileservices dot com
2004-12-21 14:48 ` [Bug libgcj/19109] " belyshev at lubercy dot com
2004-12-21 15:48 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19109-4@http.gcc.gnu.org/bugzilla/>
2015-10-20 16:30 ` hjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).