This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgcj/7766: ZipInputStream.available returns 0 immediately after construction


>Number:         7766
>Category:       libgcj
>Synopsis:       ZipInputStream.available returns 0 immediately after construction
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 29 16:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jesse Rosenstock
>Release:        3.3 20020828 (experimental)
>Organization:
>Environment:
System: Linux churchill 2.4.3-12 #1 Fri Jun 8 15:05:56 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/home/user/jmr/app/gcc --enable-langs=c++,java --enable-shared --enable-threads=posix --with-as=/home/user/jmr/app/binutils/bin/as --with-ld=/home/user/jmr/app/binutils/bin/ld : (reconfigured) 
>Description:
	Immediately after construction of a ZipInputStream, available()
        will return 0.  Sun's javadoc states, "Returns 0 after EOF has
        reached for the current entry data, otherwise always return 1."
        My interpretation is there is no current entry, so EOF hasn't
        been reached on it yet, so return 1.
>How-To-Repeat:
; cat ZISAvailTest.java
import java.net.URL;
import java.util.zip.ZipInputStream;

public class ZISAvailTest {
    public static void main(String[] s) throws Exception {
        URL u = new URL("http://www.xwt.org/dist/xwt-0258.jar";);
        System.err.println(new ZipInputStream(u.openStream()).available());
    }
}

; gcj ZISAvailTest.java --main=ZISAvailTest      
; ./a.out
0

Whereas Sun's jdk gives:
; javac ZISAvailTest.java
; java ZISAvailTest
1

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]