jdk/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java
changeset 6313 470912c9e214
parent 5506 202f599c92aa
child 6320 6b48de58428e
equal deleted inserted replaced
6308:7d860a571385 6313:470912c9e214
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    26 
    26 
    27 package com.sun.java.util.jar.pack;
    27 package com.sun.java.util.jar.pack;
    28 
    28 
    29 import java.nio.*;
    29 import java.nio.*;
    30 import java.io.*;
    30 import java.io.*;
    31 import java.nio.channels.*;
       
    32 import java.util.Date;
       
    33 import java.util.jar.*;
    31 import java.util.jar.*;
    34 import java.util.zip.*;
    32 import java.util.zip.*;
    35 import java.util.*;
       
    36 //import com.sun.java.util.jar.pack.Pack200;
       
    37 
       
    38 
    33 
    39 class NativeUnpack {
    34 class NativeUnpack {
    40     // Pointer to the native unpacker obj
    35     // Pointer to the native unpacker obj
    41     private long unpackerPtr;
    36     private long unpackerPtr;
    42 
    37 
    89     }
    84     }
    90 
    85 
    91     NativeUnpack(UnpackerImpl p200) {
    86     NativeUnpack(UnpackerImpl p200) {
    92         super();
    87         super();
    93         _p200  = p200;
    88         _p200  = p200;
    94         _props = p200._props;
    89         _props = p200.props;
    95         p200._nunp = this;
    90         p200._nunp = this;
    96     }
    91     }
    97 
    92 
    98     // for JNI callbacks
    93     // for JNI callbacks
    99     static private Object currentInstance() {
    94     static private Object currentInstance() {
   100         UnpackerImpl p200 = (UnpackerImpl) Utils.currentInstance.get();
    95         UnpackerImpl p200 = (UnpackerImpl) Utils.getTLGlobals();
   101         return (p200 == null)? null: p200._nunp;
    96         return (p200 == null)? null: p200._nunp;
   102     }
    97     }
   103 
    98 
   104     // Callback from the unpacker engine to get more data.
    99     // Callback from the unpacker engine to get more data.
   105     private long readInputFn(ByteBuffer pbuf, long minlen) throws IOException {
   100     private long readInputFn(ByteBuffer pbuf, long minlen) throws IOException {