Name: sdC67446 Date: 02/14/2000
The doc for 'java.util.zip.ZipEntry' says that
setExtra(byte[] extra) should throw IllegalArgumentException if
'extra'.length>(0xFFFFF). In fact the method throws IAE if
'extra'.length>(0xFFFF).
It must be a typo..
The java-doc says:
------------------------------------------------------------
/**
* Sets the optional extra field data for the entry.
* @param extra the extra field data bytes
* @exception IllegalArgumentException if the length of the specified
* extra field data is greater than 0xFFFFF bytes
* @see #getExtra()
*/
public void setExtra(byte[] extra)
The demo:
------------------------------------------------------------
import java.util.zip.*;
public class Test {
public static void main(String[] args) {
ZipEntry ze = new ZipEntry("Big Bog Bug!");
ze.setExtra(new byte[0xFFFF+1]);
}
}
The output:
------------------------------------------------------------
Exception in thread "main" java.lang.IllegalArgumentException: invalid extra field length
at java.util.zip.ZipEntry.setExtra(ZipEntry.java:235)
at Test.main(Test.java:5)
------------------------------------------------------------
======================================================================