1 |
/* java.util.zip.ZipOutputStream |
/* ZipOutputStream.java -- |
2 |
Copyright (C) 2001 Free Software Foundation, Inc. |
Copyright (C) 2001, 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
71 |
/** |
/** |
72 |
* Our Zip version is hard coded to 1.0 resp. 2.0 |
* Our Zip version is hard coded to 1.0 resp. 2.0 |
73 |
*/ |
*/ |
74 |
private final static int ZIP_STORED_VERSION = 10; |
private static final int ZIP_STORED_VERSION = 10; |
75 |
private final static int ZIP_DEFLATED_VERSION = 20; |
private static final int ZIP_DEFLATED_VERSION = 20; |
76 |
|
|
77 |
/** |
/** |
78 |
* Compression method. This method doesn't compress at all. |
* Compression method. This method doesn't compress at all. |
79 |
*/ |
*/ |
80 |
public final static int STORED = 0; |
public static final int STORED = 0; |
81 |
|
|
82 |
/** |
/** |
83 |
* Compression method. This method uses the Deflater. |
* Compression method. This method uses the Deflater. |
84 |
*/ |
*/ |
85 |
public final static int DEFLATED = 8; |
public static final int DEFLATED = 8; |
86 |
|
|
87 |
/** |
/** |
88 |
* Creates a new Zip output stream, writing a zip archive. |
* Creates a new Zip output stream, writing a zip archive. |
137 |
/** |
/** |
138 |
* Write an unsigned short in little endian byte order. |
* Write an unsigned short in little endian byte order. |
139 |
*/ |
*/ |
140 |
private final void writeLeShort(int value) throws IOException |
private void writeLeShort(int value) throws IOException |
141 |
{ |
{ |
142 |
out.write(value & 0xff); |
out.write(value & 0xff); |
143 |
out.write((value >> 8) & 0xff); |
out.write((value >> 8) & 0xff); |
146 |
/** |
/** |
147 |
* Write an int in little endian byte order. |
* Write an int in little endian byte order. |
148 |
*/ |
*/ |
149 |
private final void writeLeInt(int value) throws IOException |
private void writeLeInt(int value) throws IOException |
150 |
{ |
{ |
151 |
writeLeShort(value); |
writeLeShort(value); |
152 |
writeLeShort(value >> 16); |
writeLeShort(value >> 16); |