22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26
27 package com.sun.java.util.jar.pack;
28
29 import java.io.BufferedInputStream;
30 import java.io.File;
31 import java.io.FileInputStream;
32 import java.io.IOException;
33 import java.io.InputStream;
34 import java.nio.ByteBuffer;
35 import java.util.jar.JarOutputStream;
36 import java.util.jar.Pack200;
37 import java.util.zip.CRC32;
38 import java.util.zip.Deflater;
39 import java.util.zip.ZipEntry;
40 import java.util.zip.ZipOutputStream;
41
42 class NativeUnpack {
43 // Pointer to the native unpacker obj
44 private long unpackerPtr;
45
46 // Input stream.
47 private BufferedInputStream in;
48
49 private static synchronized native void initIDs();
50
51 // Starts processing at the indicated position in the buffer.
52 // If the buffer is null, the readInputFn callback is used to get bytes.
53 // Returns (s<<32|f), the number of following segments and files.
54 private synchronized native long start(ByteBuffer buf, long offset);
55
56 // Returns true if there's another, and fills in the parts.
57 private synchronized native boolean getNextFile(Object[] parts);
58
59 private synchronized native ByteBuffer getUnusedInput();
60
61 // Resets the engine and frees all resources.
|
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26
27 package com.sun.java.util.jar.pack;
28
29 import java.io.BufferedInputStream;
30 import java.io.File;
31 import java.io.FileInputStream;
32 import java.io.IOException;
33 import java.io.InputStream;
34 import java.nio.ByteBuffer;
35 import java.util.jar.JarOutputStream;
36 import java.util.jar.Pack200;
37 import java.util.zip.CRC32;
38 import java.util.zip.Deflater;
39 import java.util.zip.ZipEntry;
40 import java.util.zip.ZipOutputStream;
41
42 @SuppressWarnings({"removal"})
43 class NativeUnpack {
44 // Pointer to the native unpacker obj
45 private long unpackerPtr;
46
47 // Input stream.
48 private BufferedInputStream in;
49
50 private static synchronized native void initIDs();
51
52 // Starts processing at the indicated position in the buffer.
53 // If the buffer is null, the readInputFn callback is used to get bytes.
54 // Returns (s<<32|f), the number of following segments and files.
55 private synchronized native long start(ByteBuffer buf, long offset);
56
57 // Returns true if there's another, and fills in the parts.
58 private synchronized native boolean getNextFile(Object[] parts);
59
60 private synchronized native ByteBuffer getUnusedInput();
61
62 // Resets the engine and frees all resources.
|