Delete libcore, now in its own project

Change-Id: Ibea0a93049e4fe0ae376f5b7647a41e3d548d7a9
diff --git a/libcore/Android.mk b/libcore/Android.mk
deleted file mode 100644
index 31db2f4..0000000
--- a/libcore/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2009 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-
-
-#
-# Include the definitions to build the Java code.
-#
-
-include $(LOCAL_PATH)/JavaLibrary.mk
-
-
-#
-# Include the definitions to build the native code.
-#
-
-include $(LOCAL_PATH)/NativeCode.mk
diff --git a/libcore/AndroidManifest.xml b/libcore/AndroidManifest.xml
deleted file mode 100644
index e5321b7..0000000
--- a/libcore/AndroidManifest.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="android.core.tests">
-
-    <uses-permission android:name="android.permission.INTERNET" />
-
-    <application>
-        <uses-library android:name="android.test.runner" />
-    </application>
-
-    <instrumentation android:name="android.test.InstrumentationTestRunner"
-                     android:targetPackage="android.core.tests"
-                     android:label="cts core tests"/>
-
-    <instrumentation android:name="android.test.InstrumentationCoreTestRunner"
-                     android:targetPackage="android.core.tests"
-                     android:label="cts core tests"/>
-
-</manifest>
diff --git a/libcore/JavaLibrary.mk b/libcore/JavaLibrary.mk
deleted file mode 100644
index 64fdb7e..0000000
--- a/libcore/JavaLibrary.mk
+++ /dev/null
@@ -1,184 +0,0 @@
-# Copyright (C) 2007 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#
-# Definitions for building the Java library and associated tests.
-#
-
-#
-# Common definitions for host and target.
-#
-
-# The core library is divided into modules. Each module has a separate
-# Java source directory, and some (hopefully eventually all) also have
-# a directory for tests.
-
-define all-core-java-files
-$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find */src/$(1)/java -name "*.java"))
-endef
-
-# Redirect ls stderr to /dev/null because the corresponding resources
-# directories don't always exist.
-define all-core-resource-dirs
-$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null)
-endef
-
-# The core Java files and associated resources.
-core_src_files := $(call all-core-java-files,main)
-core_resource_dirs := $(call all-core-resource-dirs,main)
-
-# The test Java files and associated resources.
-test_src_files := $(call all-core-java-files,test)
-test_resource_dirs := $(call all-core-resource-dirs,test)
-
-
-#
-# Build for the target (device).
-#
-
-# Definitions to make the core library.
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(core_src_files)
-LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
-
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_DX_FLAGS := --core-library
-
-LOCAL_NO_EMMA_INSTRUMENT := true
-LOCAL_NO_EMMA_COMPILE := true
-
-LOCAL_MODULE := core
-
-include $(BUILD_JAVA_LIBRARY)
-
-core-intermediates := ${intermediates}
-
-
-# Definitions to make the core-tests library.
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(test_src_files)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core
-LOCAL_DX_FLAGS := --core-library
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests
-
-include $(BUILD_JAVA_LIBRARY)
-
-
-
-# This one's tricky. One of our tests needs to have a
-# resource with a "#" in its name, but Perforce doesn't
-# allow us to submit such a file. So we create it here
-# on-the-fly.
-TMP_RESOURCE_DIR := $(OUT_DIR)/tmp/
-TMP_RESOURCE_FILE := org/apache/harmony/luni/tests/java/lang/test\#.properties
-
-$(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE):
-	@mkdir -p $(dir $@)
-	@echo "Hello, world!" > $@
-
-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE)
-$(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE)
-
-# Definitions for building a version of the core-tests.jar
-# that is suitable for execution on the RI. This JAR would
-# be better located in $HOST_OUT_JAVA_LIBRARIES, but it is
-# not possible to refer to that from a shell script (the
-# variable is not exported from envsetup.sh). There is also
-# some trickery involved: we need to include some classes
-# that reside in core.jar, but since we cannot incldue the
-# whole core.jar in the RI classpath, we copy those classses
-# over to our new file.
-HOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar
-
-$(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
-$(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates)
-$(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE)
-	@rm -rf $(dir $<)/hostctsclasses
-	$(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses)
-	@unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses
-	@cp $< $@
-	@jar uf $@ -C $(dir $<)hostctsclasses .
-
-$(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR)
-
-$(LOCAL_INSTALLED_MODULE): run-core-tests
-
-# Definitions to copy the core-tests runner script.
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := run-core-tests
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := run-core-tests
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := run-core-tests-on-ri
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := run-core-tests-on-ri
-include $(BUILD_PREBUILT)
-
-
-#
-# Build for the host.
-#
-
-ifeq ($(WITH_HOST_DALVIK),true)
-
-    # Definitions to make the core library.
-
-    include $(CLEAR_VARS)
-
-    LOCAL_SRC_FILES := $(core_src_files)
-    LOCAL_JAVA_RESOURCE_DIRS := $(core_resource_dirs)
-
-    LOCAL_NO_STANDARD_LIBRARIES := true
-    LOCAL_DX_FLAGS := --core-library
-
-    LOCAL_NO_EMMA_INSTRUMENT := true
-    LOCAL_NO_EMMA_COMPILE := true
-
-    LOCAL_MODULE := core
-
-    include $(BUILD_HOST_JAVA_LIBRARY)
-
-
-    # Definitions to make the core-tests library.
-
-    include $(CLEAR_VARS)
-
-    LOCAL_SRC_FILES := $(test_src_files)
-    LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-
-    LOCAL_NO_STANDARD_LIBRARIES := true
-    LOCAL_JAVA_LIBRARIES := core
-    LOCAL_DX_FLAGS := --core-library
-
-    LOCAL_MODULE_TAGS := tests
-    LOCAL_MODULE := core-tests
-
-    include $(BUILD_HOST_JAVA_LIBRARY)
-
-endif
diff --git a/libcore/NOTICE b/libcore/NOTICE
deleted file mode 100644
index 39a4ea2..0000000
--- a/libcore/NOTICE
+++ /dev/null
@@ -1,409 +0,0 @@
-   =========================================================================
-   ==  NOTICE file corresponding to the section 4 d of                    ==
-   ==  the Apache License, Version 2.0,                                   ==
-   ==  in this case for the Android-specific code.                        ==
-   =========================================================================
-
-Android Code
-Copyright 2005-2008 The Android Open Source Project
-
-This product includes software developed as part of
-The Android Open Source Project (http://source.android.com).
-
-   =========================================================================
-   ==  NOTICE file corresponding to the section 4 d of                    ==
-   ==  the Apache License, Version 2.0,                                   ==
-   ==  in this case for the Apache Harmony distribution.                  ==
-   =========================================================================
-
-Apache Harmony
-Copyright 2006 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-Portions of Harmony were originally developed by
-Intel Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "Intel Harmony CLA".
-
-
-   =========================================================================
-   ==  NOTICE file for the Bouncy Castle License.                         ==
-   =========================================================================
-
-Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle
-(http://www.bouncycastle.org)
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-   =========================================================================
-   ==  NOTICE file for the ICU License.                                   ==
-   =========================================================================
-
-Copyright (c) 1995-2006 International Business Machines Corporation and others
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies of
-the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
-SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-of the copyright holder.
-
-All trademarks and registered trademarks mentioned herein are the
-property of their respective owners.
-
-
-   =========================================================================
-   ==  NOTICE file for the JUnit License.                                 ==
-   =========================================================================
-
-Common Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-      a) in the case of the initial Contributor, the initial code and
-         documentation distributed under this Agreement, and
-      b) in the case of each subsequent Contributor:
-
-      i) changes to the Program, and
-
-      ii) additions to the Program;
-
-      where such changes and/or additions to the Program originate
-      from and are distributed by that particular Contributor. A
-      Contribution 'originates' from a Contributor if it was added to
-      the Program by such Contributor itself or anyone acting on such
-      Contributor's behalf. Contributions do not include additions to
-      the Program which: (i) are separate modules of software
-      distributed in conjunction with the Program under their own
-      license agreement, and (ii) are not derivative works of the
-      Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor
-which are necessarily infringed by the use or sale of its Contribution
-alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this
-Agreement.
-
-"Recipient" means anyone who receives the Program under this
-Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-      a) Subject to the terms of this Agreement, each Contributor
-      hereby grants Recipient a non-exclusive, worldwide, royalty-free
-      copyright license to reproduce, prepare derivative works of,
-      publicly display, publicly perform, distribute and sublicense
-      the Contribution of such Contributor, if any, and such
-      derivative works, in source code and object code form.
-
-      b) Subject to the terms of this Agreement, each Contributor
-      hereby grants Recipient a non-exclusive, worldwide, royalty-free
-      patent license under Licensed Patents to make, use, sell, offer
-      to sell, import and otherwise transfer the Contribution of such
-      Contributor, if any, in source code and object code form. This
-      patent license shall apply to the combination of the
-      Contribution and the Program if, at the time the Contribution is
-      added by the Contributor, such addition of the Contribution
-      causes such combination to be covered by the Licensed Patents.
-      The patent license shall not apply to any other combinations
-      which include the Contribution. No hardware per se is licensed
-      hereunder.
-
-      c) Recipient understands that although each Contributor grants
-      the licenses to its Contributions set forth herein, no
-      assurances are provided by any Contributor that the Program does
-      not infringe the patent or other intellectual property rights of
-      any other entity. Each Contributor disclaims any liability to
-      Recipient for claims brought by any other entity based on
-      infringement of intellectual property rights or otherwise. As a
-      condition to exercising the rights and licenses granted
-      hereunder, each Recipient hereby assumes sole responsibility to
-      secure any other intellectual property rights needed, if any.
-      For example, if a third party patent license is required to
-      allow Recipient to distribute the Program, it is Recipient's
-      responsibility to acquire that license before distributing the
-      Program.
-
-      d) Each Contributor represents that to its knowledge it has
-      sufficient copyright rights in its Contribution, if any, to
-      grant the copyright license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form
-under its own license agreement, provided that:
-
-      a) it complies with the terms and conditions of this Agreement; and
-
-      b) its license agreement:
-
-      i) effectively disclaims on behalf of all Contributors all
-      warranties and conditions, express and implied, including
-      warranties or conditions of title and non-infringement, and
-      implied warranties or conditions of merchantability and fitness
-      for a particular purpose;
-
-      ii) effectively excludes on behalf of all Contributors all
-      liability for damages, including direct, indirect, special,
-      incidental and consequential damages, such as lost profits;
-
-      iii) states that any provisions which differ from this Agreement
-      are offered by that Contributor alone and not by any other
-      party; and
-
-      iv) states that source code for the Program is available from
-      such Contributor, and informs licensees how to obtain it in a
-      reasonable manner on or through a medium customarily used for
-      software exchange.
-
-When the Program is made available in source code form:
-
-      a) it must be made available under this Agreement; and 
-
-      b) a copy of this Agreement must be included with each copy of
-      the Program.
-
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain
-responsibilities with respect to end users, business partners and the
-like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a
-commercial product offering should do so in a manner which does not
-create potential liability for other Contributors. Therefore, if a
-Contributor includes the Program in a commercial product offering,
-such Contributor ("Commercial Contributor") hereby agrees to defend
-and indemnify every other Contributor ("Indemnified Contributor")
-against any losses, damages and costs (collectively "Losses") arising
-from claims, lawsuits and other legal actions brought by a third party
-against the Indemnified Contributor to the extent caused by the acts
-or omissions of such Commercial Contributor in connection with its
-distribution of the Program in a commercial product offering. The
-obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement.
-In order to qualify, an Indemnified Contributor must: a) promptly
-notify the Commercial Contributor in writing of such claim, and b)
-allow the Commercial Contributor to control, and cooperate with the
-Commercial Contributor in, the defense and any related settlement
-negotiations. The Indemnified Contributor may participate in any such
-claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
-WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and
-distributing the Program and assumes all risks associated with its
-exercise of rights under this Agreement, including but not limited to
-the risks and costs of program errors, compliance with applicable
-laws, damage to or loss of data, programs or equipment, and
-unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further
-action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against a Contributor with
-respect to a patent applicable to software (including a cross-claim or
-counterclaim in a lawsuit), then any patent licenses granted by that
-Contributor to such Recipient under this Agreement shall terminate as
-of the date such litigation is filed. In addition, if Recipient
-institutes patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Program
-itself (excluding combinations of the Program with other software or
-hardware) infringes such Recipient's patent(s), then such Recipient's
-rights granted under Section 2(b) shall terminate as of the date such
-litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it
-fails to comply with any of the material terms or conditions of this
-Agreement and does not cure such failure in a reasonable period of
-time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use
-and distribution of the Program as soon as reasonably practicable.
-However, Recipient's obligations under this Agreement and any licenses
-granted by Recipient relating to the Program shall continue and
-survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted and
-may only be modified in the following manner. The Agreement Steward
-reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement
-Steward has the right to modify this Agreement. IBM is the initial
-Agreement Steward. IBM may assign the responsibility to serve as the
-Agreement Steward to a suitable separate entity. Each new version of
-the Agreement will be given a distinguishing version number. The
-Program (including Contributions) may always be distributed subject to
-the version of the Agreement under which it was received. In addition,
-after a new version of the Agreement is published, Contributor may
-elect to distribute the Program (including its Contributions) under
-the new version. Except as expressly stated in Sections 2(a) and 2(b)
-above, Recipient receives no rights or licenses to the intellectual
-property of any Contributor under this Agreement, whether expressly,
-by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and
-the intellectual property laws of the United States of America. No
-party to this Agreement will bring a legal action under this Agreement
-more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.
-
-
-   =========================================================================
-   ==  NOTICE file for the KXML License.                                  ==
-   =========================================================================
-
-Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-   =========================================================================
-   ==  NOTICE file for the SQLite Java Wrapper License.                   ==
-   =========================================================================
-
-This software is copyrighted by Christian Werner <chw@ch-werner.de>
-and others. The following terms apply to all files associated with the
-software unless explicitly disclaimed in individual files.
-
-The authors hereby grant permission to use, copy, modify, distribute,
-and license this software and its documentation for any purpose, provided
-that existing copyright notices are retained in all copies and that this
-notice is included verbatim in any distributions. No written agreement,
-license, or royalty fee is required for any of the authorized uses.
-Modifications to this software may be copyrighted by their authors
-and need not follow the licensing terms described here, provided that
-the new terms are clearly indicated on the first page of each file where
-they apply.
-
-IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
-FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
-DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
-IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
-NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
-MODIFICATIONS.
-
-
-   =========================================================================
-   ==  NOTICE file for the W3C License.                                   ==
-   =========================================================================
-
-Copyright (c) 2000 World Wide Web Consortium, (Massachusetts Institute
-of Technology, Institut National de Recherche en Informatique et en
-Automatique, Keio University). All Rights Reserved. This program is
-distributed under the W3C's Software Intellectual Property License.
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-See W3C License http://www.w3.org/Consortium/Legal/ for more details.
diff --git a/libcore/NativeCode.mk b/libcore/NativeCode.mk
deleted file mode 100644
index 57c4903..0000000
--- a/libcore/NativeCode.mk
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2007 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#
-# Definitions for building the native code needed for the core library.
-#
-
-#
-# Common definitions for host and target.
-#
-
-# Get the list of all native directories that contain sub.mk files.
-# We're using "sub.mk" to make it clear that these are not typical
-# android makefiles.
-define all-core-native-dirs
-$(patsubst %/sub.mk,%,$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/native/sub.mk 2> /dev/null))
-endef
-
-# These two definitions are used to help sanity check what's put in
-# sub.mk. See, the "error" directives immediately below.
-core_magic_local_target := ...//::default:://...
-core_local_path := $(LOCAL_PATH)
-
-# Include a submakefile, resolve its source file locations,
-# and stick them on core_src_files.  The submakefiles are
-# free to append to LOCAL_SRC_FILES, LOCAL_C_INCLUDES,
-# LOCAL_SHARED_LIBRARIES, or LOCAL_STATIC_LIBRARIES, but nothing
-# else. All other LOCAL_* variables will be ignored.
-#
-# $(1): directory containing the makefile to include
-define include-core-native-dir
-    LOCAL_SRC_FILES :=
-    include $(LOCAL_PATH)/$(1)/sub.mk
-    ifneq ($$(LOCAL_MODULE),$(core_magic_local_target))
-        $$(error $(LOCAL_PATH)/$(1)/sub.mk should not include CLEAR_VARS \
-            or define LOCAL_MODULE)
-    endif
-    ifneq ($$(LOCAL_PATH),$(core_local_path))
-        $$(error $(LOCAL_PATH)/$(1)/sub.mk should not define LOCAL_PATH)
-    endif
-    core_src_files += $$(addprefix $(1)/,$$(LOCAL_SRC_FILES))
-    LOCAL_SRC_FILES :=
-endef
-
-# Find any native directories containing sub.mk files.
-core_native_dirs := $(strip $(call all-core-native-dirs,main))
-ifeq ($(core_native_dirs),)
-    $(error No native code defined for libcore)
-endif
-
-# Set up the default state. Note: We use CLEAR_VARS here, even though
-# we aren't quite defining a new rule yet, to make sure that the
-# sub.mk files don't see anything stray from the last rule that was
-# set up.
-include $(CLEAR_VARS)
-LOCAL_MODULE := $(core_magic_local_target)
-core_src_files :=
-
-# Include the sub.mk files.
-$(foreach dir, \
-    $(core_native_dirs), \
-    $(eval $(call include-core-native-dir,$(dir))))
-
-# Extract out the allowed LOCAL_* variables. Note: $(sort) also
-# removes duplicates.
-core_c_includes := $(sort dalvik/libcore/include $(LOCAL_C_INCLUDES) $(JNI_H_INCLUDE))
-core_shared_libraries := $(sort $(LOCAL_SHARED_LIBRARIES))
-core_static_libraries := $(sort $(LOCAL_STATIC_LIBRARIES))
-
-
-#
-# Build for the target (device).
-#
-
-include $(CLEAR_VARS)
-
-# Define the rules.
-LOCAL_SRC_FILES := $(core_src_files)
-LOCAL_C_INCLUDES := $(core_c_includes)
-LOCAL_SHARED_LIBRARIES := $(core_shared_libraries)
-LOCAL_STATIC_LIBRARIES := $(core_static_libraries)
-LOCAL_MODULE := libjavacore
-include $(BUILD_STATIC_LIBRARY)
-
-# Deal with keystores required for security. Note: The path to this file
-# is hardcoded in TrustManagerFactoryImpl.java.
-ALL_PREBUILT += $(TARGET_OUT)/etc/security/cacerts.bks
-$(TARGET_OUT)/etc/security/cacerts.bks : $(LOCAL_PATH)/security/src/main/files/cacerts.bks | $(ACP)
-	$(transform-prebuilt-to-target)
-
-
-#
-# Build for the host.
-#
-
-ifeq ($(WITH_HOST_DALVIK),true)
-
-    include $(CLEAR_VARS)
-
-    # Define the rules.
-    LOCAL_SRC_FILES := $(core_src_files)
-    LOCAL_C_INCLUDES := $(core_c_includes)
-    LOCAL_SHARED_LIBRARIES := $(core_shared_libraries)
-    LOCAL_STATIC_LIBRARIES := $(core_static_libraries)
-    LOCAL_MODULE := libjavacore-host
-    include $(BUILD_HOST_STATIC_LIBRARY)
-
-    # TODO: Figure out cacerts.bks for the host.
-
-endif
diff --git a/libcore/annotation/MODULE_LICENSE_APACHE2 b/libcore/annotation/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/libcore/annotation/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/Annotation.java b/libcore/annotation/src/main/java/java/lang/annotation/Annotation.java
deleted file mode 100644
index 00707b1..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/Annotation.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines the interface implemented by all annotations. Note that the interface
- * itself is <i>not</i> an annotation, and neither is an interface that simply
- * extends this one. Only the compiler is able to create proper annotation
- * types.
- *
- * @since 1.5
- */
-public interface Annotation {
-
-    /**
-     * Returns the type of this annotation.
-     *
-     * @return A {@code Class} instance representing the annotation type.
-     */
-    Class<? extends Annotation> annotationType();
-
-    /**
-     * Determines whether or not this annotation is equivalent to the annotation
-     * passed. This is determined according to the following rules:
-     * 
-     * <ul>
-     *     <li>
-     *         Two annotations {@code x} and {@code y} are equal if and only if
-     *         they are members of the same annotation type and all the member
-     *         values of {@code x} are equal to the corresponding member values
-     *         of {@code y}.
-     *     </li>
-     *     <li>
-     *         The equality of primitive member values {@code x} and {@code y}
-     *         is determined (in a way similar to) using the corresponding
-     *         wrapper classes. For example,
-     *         {@code Integer.valueOf(x).equals(Integer.valueOf(y)} is used for
-     *         {@code int} values. Note: The behavior is identical to the
-     *         {@code ==} operator for all but the floating point type, so the
-     *         implementation may as well use {@code ==} in these cases for
-     *         performance reasons. Only for the {@code float} and {@code double}
-     *         types the result will be slightly different: {@code NaN} is equal
-     *         to {@code NaN}, and {@code -0.0} is equal to {@code 0.0}, both of
-     *         which is normally not the case.
-     *     </li>
-     *     <li>
-     *         The equality of two array member values {@code x} and {@code y}
-     *         is determined using the corresponding {@code equals(x, y)}
-     *         helper function in {@link java.util.Arrays}.
-     *     </li>
-     *     <li>
-     *         The hash code for all other member values is determined by simply
-     *         calling their {@code equals()} method.
-     *     </li>
-     * </ul>
-     *
-     * @param obj
-     *            The object to compare to.
-     *
-     * @return {@code true} if {@code obj} is equal to this annotation,
-     *            {@code false} otherwise.
-     */
-    boolean equals(Object obj);
-
-    /**
-     * Returns the hash code of this annotation. The hash code is determined
-     * according to the following rules:
-     * 
-     * <ul>
-     *     <li>
-     *         The hash code of an annotation is the sum of the hash codes of
-     *         its annotation members.
-     *     </li>
-     *     <li>
-     *         The hash code of an annotation member is calculated as {@code
-     *         (0x7f * n.hashCode()) ^ v.hashCode())}, where {@code n} is the
-     *         name of the member (as a {@code String}) and {@code v} its value.
-     *     </li>
-     *     <li>
-     *         The hash code for a primitive member value is determined using
-     *         the corresponding wrapper type. For example, {@code
-     *         Integer.valueOf(v).hashCode()} is used for an {@code int} value
-     *         {@code v}.
-     *     </li>
-     *     <li>
-     *         The hash code for an array member value {@code v} is determined
-     *         using the corresponding {@code hashCode(v)} helper function in
-     *         {@link java.util.Arrays}.
-     *     </li>
-     *     <li>
-     *         The hash code for all other member values is determined by simply
-     *         calling their {@code hashCode} method.
-     *     </li>
-     * </ul>
-     *
-     * @return the hash code.
-     */
-    int hashCode();
-
-    /**
-     * Returns a {@code String} representation of this annotation. It is not
-     * strictly defined what the representation has to look like, but it usually
-     * consists of the name of the annotation, preceded by a "@". If the
-     * annotation contains field members, their names and values are also
-     * included in the result.
-     * 
-     * @return the {@code String} that represents this annotation.
-     */
-    String toString();
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java b/libcore/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
deleted file mode 100644
index 67775c7..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Indicates that an annotation in the binary representation of a class is
- * syntactically incorrect and the annotation parser is unable to process it.
- * This exception is unlikely to ever occur, given that the code has been
- * compiled by an ordinary Java compiler.
- *
- * @since 1.5
- */
-public class AnnotationFormatError extends Error {
-
-    private static final long serialVersionUID = -4256701562333669892L;
-
-    /**
-     * Constructs an instance with the message provided.
-     *
-     * @param message
-     *            the details of the error.
-     */
-    public AnnotationFormatError(String message) {
-        super(message);
-    }
-
-    /**
-     * Constructs an instance with a message and a cause.
-     *
-     * @param message
-     *            the details of the error.
-     * @param cause
-     *            the cause of the error or {@code null} if none.
-     */
-    public AnnotationFormatError(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Constructs an instance with a cause. If the cause is not
-     * {@code null}, then {@code cause.toString()} is used as the
-     * error's message.
-     *
-     * @param cause
-     *            the cause of the error or {@code null} if none.
-     */
-    public AnnotationFormatError(Throwable cause) {
-        super(cause == null ? null : cause.toString(), cause);
-    }
-
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java b/libcore/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
deleted file mode 100644
index 0ff79ec..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-import java.lang.reflect.Method;
-
-import org.apache.harmony.annotation.internal.nls.Messages;
-
-/**
- * Indicates that an annotation type has changed since it was compiled or
- * serialized.
- *
- * @since 1.5
- */
-public class AnnotationTypeMismatchException extends RuntimeException {
-
-    private static final long serialVersionUID = 8125925355765570191L;
-
-    private Method element;
-
-    private String foundType;
-
-    /**
-     * Constructs an instance for the given type element and the type found.
-     *
-     * @param element
-     *            the annotation type element.
-     * @param foundType
-     *            the invalid type that was found. This is actually the textual
-     *            type description found in the binary class representation,
-     *            so it may not be human-readable.
-     */
-    public AnnotationTypeMismatchException(Method element, String foundType) {
-        super(Messages.getString("annotation.1", element, foundType)); //$NON-NLS-1$
-        this.element = element;
-        this.foundType = foundType;
-    }
-
-    /**
-     * Returns the method object for the invalid type.
-     *
-     * @return a {@link Method} instance.
-     */
-    public Method element() {
-        return element;
-    }
-
-    /**
-     * Returns the invalid type.
-     *
-     * @return a string describing the invalid data.
-     */
-    public String foundType() {
-        return foundType;
-    }
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/Documented.java b/libcore/annotation/src/main/java/java/lang/annotation/Documented.java
deleted file mode 100644
index 7e7f72f..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/Documented.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines a meta-annotation for indicating that an annotation is documented and
- * considered part of the public API.
- *
- * @since 1.5
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Documented {
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/ElementType.java b/libcore/annotation/src/main/java/java/lang/annotation/ElementType.java
deleted file mode 100644
index f0f52aa..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/ElementType.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines an enumeration for Java program elements. It is used in conjunction
- * with the {@link Target} meta-annotation to restrict the use of an annotation
- * to certain program elements.
- *
- * @since 1.5
- */
-public enum ElementType {
-    /**
-     * Class, interface or enum declaration.
-     */
-    TYPE,
-    /**
-     * Field declaration.
-     */
-    FIELD,
-    /**
-     * Method declaration.
-     */
-    METHOD,
-    /**
-     * Parameter declaration.
-     */
-    PARAMETER,
-    /**
-     * Constructor declaration.
-     */
-    CONSTRUCTOR,
-    /**
-     * Local variable declaration.
-     */
-    LOCAL_VARIABLE,
-    /**
-     * Annotation type declaration.
-     */
-    ANNOTATION_TYPE,
-    /**
-     * Package declaration.
-     */
-    PACKAGE
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java b/libcore/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
deleted file mode 100644
index a5d2068..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-import org.apache.harmony.annotation.internal.nls.Messages;
-
-/**
- * Indicates that an element of an annotation type was accessed that was added
- * after the type was compiled or serialized. This does not apply to new
- * elements that have default values.
- *
- * @since 1.5
- */
-public class IncompleteAnnotationException extends RuntimeException {
-
-    private static final long serialVersionUID = 8445097402741811912L;
-
-    private Class<? extends Annotation> annotationType;
-
-    private String elementName;
-
-    /**
-     * Constructs an instance with the incomplete annotation type and the name
-     * of the element that's missing.
-     *
-     * @param annotationType
-     *            the annotation type.
-     * @param elementName
-     *            the name of the incomplete element.
-     */
-    public IncompleteAnnotationException(
-            Class<? extends Annotation> annotationType, String elementName) {
-        super(Messages.getString("annotation.0", elementName, annotationType.getName())); //$NON-NLS-1$
-        this.annotationType = annotationType;
-        this.elementName = elementName;
-    }
-
-    /**
-     * Returns the annotation type.
-     *
-     * @return a Class instance.
-     */
-    public Class<? extends Annotation> annotationType() {
-        return annotationType;
-    }
-
-    /**
-     * Returns the incomplete element's name.
-     *
-     * @return the name of the element.
-     */
-    public String elementName() {
-        return elementName;
-    }
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/Inherited.java b/libcore/annotation/src/main/java/java/lang/annotation/Inherited.java
deleted file mode 100644
index 730d30a..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/Inherited.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines a meta-annotation for indicating that an annotation is automatically
- * inherited.
- *
- * @since 1.5
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Inherited {
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/Retention.java b/libcore/annotation/src/main/java/java/lang/annotation/Retention.java
deleted file mode 100644
index 275739e..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/Retention.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines a meta-annotation for determining the scope of retention for an
- * annotation. If the retention annotation is not set {@code
- * RetentionPolicy.CLASS} is used as default retention.
- *
- * @since 1.5
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Retention {
-    RetentionPolicy value();
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java b/libcore/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
deleted file mode 100644
index 70de3b0..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines an enumeration for annotation retention policies. Used in conjunction
- * with the {@link Retention} annotation to specify an annotation's time-to-live
- * in the overall development life cycle.
- *
- * @since 1.5
- */
-public enum RetentionPolicy {
-    /**
-     * Annotation is only available in the source code.
-     */
-    SOURCE,
-    /**
-     * Annotation is available in the source code and in the class file, but not
-     * at runtime. This is the default policy.
-     */
-    CLASS,
-    /**
-     * Annotation is available in the source code, the class file and is
-     * available at runtime.
-     */
-    RUNTIME
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/Target.java b/libcore/annotation/src/main/java/java/lang/annotation/Target.java
deleted file mode 100644
index 4ba0938..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/Target.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package java.lang.annotation;
-
-/**
- * Defines a meta-annotation for determining what {@link ElementType}s an
- * annotation can be applied to.
- *
- * @since 1.5
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Target {
-    ElementType[] value();
-}
diff --git a/libcore/annotation/src/main/java/java/lang/annotation/package.html b/libcore/annotation/src/main/java/java/lang/annotation/package.html
deleted file mode 100644
index 99c98cc..0000000
--- a/libcore/annotation/src/main/java/java/lang/annotation/package.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-  <body>
-    <p>
-      Defines interfaces and exceptions necessary for annotation support. Also
-      provides some predefined annotations that are used throughout the Android
-      libraries.
-    </p>
-    @since Android 1.0
-  </body>
-</html>
\ No newline at end of file
diff --git a/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java b/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java
deleted file mode 100644
index 91f3548..0000000
--- a/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * THE FILE HAS BEEN AUTOGENERATED BY MSGTOOL TOOL.
- * All changes made to this file manually will be overwritten 
- * if this tool runs again. Better make changes in the template file.
- */
-
-// BEGIN android-note
-// Redundant code has been removed and is now called from MsgHelp.
-// END android-note
-
-package org.apache.harmony.annotation.internal.nls;
-
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-// BEGIN android-changed
-import org.apache.harmony.luni.util.MsgHelp;
-// END android-changed
-
-/**
- * This class retrieves strings from a resource bundle and returns them,
- * formatting them with MessageFormat when required.
- * <p>
- * It is used by the system classes to provide national language support, by
- * looking up messages in the <code>
- *    org.apache.harmony.annotation.internal.nls.messages
- * </code>
- * resource bundle. Note that if this file is not available, or an invalid key
- * is looked up, or resource bundle support is not available, the key itself
- * will be returned as the associated message. This means that the <em>KEY</em>
- * should a reasonable human-readable (english) string.
- * 
- */
-public class Messages {
-
-    // BEGIN android-changed
-    private static final String sResource =
-        "org.apache.harmony.annotation.internal.nls.messages";
-    // END android-changed
-
-    /**
-     * Retrieves a message which has no arguments.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg) {
-        // BEGIN android-changed
-        return MsgHelp.getString(sResource, msg);
-        // END android-changed
-    }
-
-    /**
-     * Retrieves a message which takes 1 argument.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            Object the object to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object arg) {
-        return getString(msg, new Object[] { arg });
-    }
-
-    /**
-     * Retrieves a message which takes 1 integer argument.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            int the integer to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, int arg) {
-        return getString(msg, new Object[] { Integer.toString(arg) });
-    }
-
-    /**
-     * Retrieves a message which takes 1 character argument.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            char the character to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, char arg) {
-        return getString(msg, new Object[] { String.valueOf(arg) });
-    }
-
-    /**
-     * Retrieves a message which takes 2 arguments.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @param arg1
-     *            Object an object to insert in the formatted output.
-     * @param arg2
-     *            Object another object to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object arg1, Object arg2) {
-        return getString(msg, new Object[] { arg1, arg2 });
-    }
-
-    /**
-     * Retrieves a message which takes several arguments.
-     * 
-     * @param msg
-     *            String the key to look up.
-     * @param args
-     *            Object[] the objects to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object[] args) {
-        // BEGIN android-changed
-        return MsgHelp.getString(sResource, msg, args);
-        // END android-changed
-    }
-
-    // BEGIN android-note
-    // Duplicate code was dropped in favor of using MsgHelp.
-    // END android-note
-}
diff --git a/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties b/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties
deleted file mode 100644
index 613c54d..0000000
--- a/libcore/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/messages.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#  
-#      http://www.apache.org/licenses/LICENSE-2.0
-#  
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-# 
-
-# messages for EN locale
-annotation.0=The element, {0}, is not complete for the annotation {1}.
-annotation.1=The annotation element, {0}, doesn't match the type {1}.
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java
deleted file mode 100644
index e306435..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for java.nio.charset package.
- */
-public class AllTests {
-
-    public static Test suite() {
-        TestSuite suite = tests.TestSuiteFactory.createTestSuite("Test for java.lang.annotation");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AnnotationTest.class);
-        suite.addTestSuite(AnnotationFormatErrorTest.class);
-        suite.addTestSuite(AnnotationTypeMismatchExceptionTest.class);
-        suite.addTestSuite(ElementTypeTest.class);
-        suite.addTestSuite(IncompleteAnnotationExceptionTest.class);
-        suite.addTestSuite(RetentionPolicyTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java
deleted file mode 100644
index c2a32b8..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.AnnotationFormatError;
-
-/**
- * Test case of java.lang.annotation.AnnotationFormatError
- */
-@TestTargetClass(AnnotationFormatError.class) 
-public class AnnotationFormatErrorTest extends TestCase {
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AnnotationFormatError",
-        args = {java.lang.String.class}
-    )
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_String() {
-        AnnotationFormatError e = new AnnotationFormatError("some message");
-        assertEquals("some message", e.getMessage());
-    }
-
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(Throwable)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AnnotationFormatError",
-        args = {java.lang.Throwable.class}
-    )
-    public void test_constructorLjava_lang_Throwable() {
-        IllegalArgumentException iae = new IllegalArgumentException();
-        AnnotationFormatError e = new AnnotationFormatError(iae);
-        assertSame(iae, e.getCause());
-    }
-
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String,Throwable)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AnnotationFormatError",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_StringLjava_lang_Throwable() {
-        IllegalArgumentException iae = new IllegalArgumentException();
-        AnnotationFormatError e = new AnnotationFormatError("some message", iae);
-        assertEquals("some message", e.getMessage());
-        assertSame(iae, e.getCause());
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTest.java
deleted file mode 100644
index c50c0e8..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTest.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Test case of java.lang.annotation.Annotation
- */
-@TestTargetClass(value = Annotation.class,
-        untestedMethods = {
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "the spec does not require any specific output (although @something is probable)",
-                method = "toString",
-                args = {}
-            )}
-) 
-public class AnnotationTest extends TestCase {
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "annotationType",
-        args = {}
-    )
-    public void test_annotationType() {
-        Annotation [] annotations = AnnotatedClass.class.getDeclaredAnnotations();
-        assertEquals(1, annotations.length);
-        Annotation anno = annotations[0];
-        assertEquals(TestAnnotation1.class, anno.annotationType());
-    }
-    
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "equals",
-            args = { Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "hashCode",
-            args = {}
-        )
-    })
-    public void test_equals() throws Exception {
-        // test type
-        Method m1 = AnnotatedClass2.class
-                .getDeclaredMethod("a", new Class[] {});
-        Method m2 = AnnotatedClass2.class
-                .getDeclaredMethod("b", new Class[] {});
-        assertFalse("other annotation class type",
-                m1.getDeclaredAnnotations()[0].equals(m2
-                        .getDeclaredAnnotations()[0]));
-        
-        // test equality / non equality for base types and compound types
-        List<Method> methods = Arrays.asList(AnnotatedClass.class.getDeclaredMethods());
-        Map<String, List<Method>> eqs = new HashMap<String, List<Method>>();
-        Map<String, List<Method>> neqs = new HashMap<String, List<Method>>();
-        for (Method m : methods) {
-            String name = m.getName();
-            //System.out.println("name "+name);
-            Map<String, List<Method>> curT = name.charAt(0) == 'e'? eqs : neqs;
-            String testNum = name.substring(1,3); // 01
-            List<Method> mlist = curT.get(testNum);
-            if (mlist == null) {
-                mlist = new ArrayList<Method>();
-                curT.put(testNum, mlist);
-            }
-            mlist.add(AnnotatedClass.class.getDeclaredMethod(name, new Class[] {}));
-        }
-
-        for (List<Method> eqList : eqs.values()) {
-            for (int i = 0; i < eqList.size() -1; i++) {
-                for (int j = i+1; j < eqList.size(); j++) {
-                    Method me1 = eqList.get(i);
-                    Method me2 = eqList.get(j);
-                    //System.out.println("eq test for "+me1.getName()+", "+me2.getName());
-                    Annotation a1 = me1.getDeclaredAnnotations()[0];
-                    Annotation a2 = me2.getDeclaredAnnotations()[0];                    
-                    assertEquals("must be equal : method1:"+me1.getName()+", method2: "+me2.getName(), a1, a2);
-                    assertEquals("same hashcode", a1.hashCode(), a2.hashCode());
-                }
-            }
-        }
-        
-        for (List<Method> eqList : neqs.values()) {
-            for (int i = 0; i < eqList.size() -1; i++) {
-                for (int j = i+1; j < eqList.size(); j++) {
-                    Method me1 = eqList.get(i);
-                    Method me2 = eqList.get(j);
-                    Annotation a1 = me1.getDeclaredAnnotations()[0];
-                    Annotation a2 = me2.getDeclaredAnnotations()[0];  
-                    //System.out.println("ne test for "+me1.getName()+", "+me2.getName());
-                    assertFalse("must not be equal : method1:"+me1.getName()+", method2: "+me2.getName(),
-                            a1.equals(a2));
-                    if (a1.hashCode() != a2.hashCode()) {
-                        assertFalse("not same hashcode -> not equals", a1.equals(a2));
-                    }
-                }
-                
-            }
-        }
-    }
-    
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
-    public void test_hashCode() throws SecurityException, NoSuchMethodException { 
-        Annotation a1 = AnnotatedClass.class.getDeclaredAnnotations()[0];
-        assertEquals(a1.hashCode(), (127 * "value".hashCode() ^ "foobar".hashCode()));
-        // i+= 127 *(key.hashCode() ^ memberValHashCode(value);
-        
-        Method m1 = AnnotatedClass.class.getDeclaredMethod("e34c", new Class[] {});
-        int arrHc = Arrays.hashCode(new Object[]{});
-        /*
-        TestAnnotation3[] arrAnno() default {};
-        String[] arrString() default {};
-        Class[] arrClass() default {};
-        TestEnum1[] arrEnum() default {};
-         */        
-        assertEquals(
-                (127 * "arrAnno".hashCode() ^ arrHc) +
-                (127 * "arrString".hashCode() ^ arrHc)+
-                (127 * "arrClass".hashCode() ^ arrHc) +
-                (127 * "arrEnum".hashCode() ^ arrHc)
-                ,
-                m1.getDeclaredAnnotations()[0].hashCode());
-        
-        Method m2 = AnnotatedClass3.class.getDeclaredMethod("a", new Class[] {});
-        assertEquals(
-                (127 * "i".hashCode() ^ 12345),
-                m2.getDeclaredAnnotations()[0].hashCode());
-        
-    }
-}
-
-class AnnotatedClass2 {
-    @TestAnnotation3()
-    void a() {}
-    @TestAnnotation3b()
-    void b() {}
-}
-
-class AnnotatedClass3 {
-    @TestAnnotation4(i = 12345)
-    void a() {}
-}
-
-@TestAnnotation1("foobar")
-class AnnotatedClass {
-    
-    // ----- boolean -----
-    @TestAnnotation3(z = false)
-    void e01a() {}
-    @TestAnnotation3(z = false)
-    void e01b() {}
-    @TestAnnotation3()
-    void e01c() {}
-    
-    @TestAnnotation3(z = true)
-    void e02a() {}
-    @TestAnnotation3(z = true)
-    void e02b() {}
-    
-    @TestAnnotation3(z = false)
-    void n03a() {}
-    @TestAnnotation3(z = true)
-    void n03b() {}
-
-    
-    // ----- byte -----
-    @TestAnnotation3(b = 0)
-    void e04a() {}
-    @TestAnnotation3(b = 0)
-    void e04b() {}
-    @TestAnnotation3()
-    void e04c() {}
-    
-    @TestAnnotation3(b= 127)
-    void e05a() {}
-    @TestAnnotation3(b = 127)
-    void e05b() {}
-    
-    @TestAnnotation3(b = -128)
-    void n06a() {}
-    @TestAnnotation3(b = 127)
-    void n06b() {}
-    
-    
-    // ----- short -----
-    @TestAnnotation3(s = 0)
-    void e07a() {}
-    @TestAnnotation3(s = 0)
-    void e07b() {}
-    @TestAnnotation3()
-    void e07c() {}
-    
-    @TestAnnotation3(s= 32767)
-    void e08a() {}
-    @TestAnnotation3(s = 32767)
-    void e08b() {}
-    
-    @TestAnnotation3(s = -32768)
-    void n09a() {}
-    @TestAnnotation3(s = 32767)
-    void n09b() {}
-    
-    
-    // ----- int -----
-    @TestAnnotation3(i = 100)
-    void e10a() {}
-    @TestAnnotation3(i = 100)
-    void e10b() {}
-    @TestAnnotation3()
-    void e10c() {}
-    
-    @TestAnnotation3(i = Integer.MAX_VALUE)
-    void e11a() {}
-    @TestAnnotation3(i = Integer.MAX_VALUE)
-    void e11b() {}
-    
-    @TestAnnotation3(i = Integer.MAX_VALUE)
-    void n12a() {}
-    @TestAnnotation3(i = Integer.MIN_VALUE)
-    void n12b() {}
-        
-    
-    // ----- long -----
-    @TestAnnotation3(j = 0)
-    void e13a() {}
-    @TestAnnotation3(j = 0)
-    void e13b() {}
-    @TestAnnotation3()
-    void e13c() {}
-    
-    @TestAnnotation3(j = Long.MAX_VALUE)
-    void e14a() {}
-    @TestAnnotation3(j = Long.MAX_VALUE)
-    void e14b() {}
-    
-    @TestAnnotation3(j = Long.MAX_VALUE)
-    void n15a() {}
-    @TestAnnotation3(j = Long.MIN_VALUE)
-    void n15b() {}
-        
-    
-    // ----- float -----
-    @TestAnnotation3(f = 0.0f)
-    void e16a() {}
-    @TestAnnotation3(f = 0.0f)
-    void e16b() {}
-    @TestAnnotation3()
-    void e16c() {}
-    
-    @TestAnnotation3(f = Float.MAX_VALUE)
-    void e17a() {}
-    @TestAnnotation3(f = Float.MAX_VALUE)
-    void e17b() {}
-    
-    @TestAnnotation3(f = Float.NaN)
-    void e18a() {}
-    @TestAnnotation3(f = Float.NaN)
-    void e18b() {}
-
-    @TestAnnotation3(f = Long.MAX_VALUE)
-    void n19a() {}
-    @TestAnnotation3(f = Long.MIN_VALUE)
-    void n19b() {}
-
-    @TestAnnotation3(f = 0.0f)
-    void n20a() {}
-    @TestAnnotation3(f = -0.0f)
-    void n20b() {}
-        
-    
-    // ----- double -----
-    @TestAnnotation3(d = 0.0d)
-    void e21a() {}
-    @TestAnnotation3(d = 0.0d)
-    void e21b() {}
-    @TestAnnotation3()
-    void e21c() {}
-    
-    @TestAnnotation3(d = Double.MAX_VALUE)
-    void e22a() {}
-    @TestAnnotation3(d = Double.MAX_VALUE)
-    void e22b() {}
-
-    @TestAnnotation3(d = Double.NaN)
-    void e23a() {}
-    @TestAnnotation3(d = Double.NaN)
-    void e23b() {}
-
-    
-    @TestAnnotation3(d = Double.MAX_VALUE)
-    void n24a() {}
-    @TestAnnotation3(d = Double.MIN_VALUE)
-    void n24b() {}
-
-    @TestAnnotation3(d = 0.0d)
-    void n25a() {}
-    @TestAnnotation3(d = -0.0d)
-    void n25b() {}
-        
-    
- // ----- String -----
-    @TestAnnotation3(aString = "")
-    void e26a() {}
-    @TestAnnotation3(aString = "")
-    void e26b() {}
-    @TestAnnotation3()
-    void e26c() {}
-    
-    @TestAnnotation3(aString = "asjdfk jkls dfjklsd fklsd jklds kflds jfkldsfjd"+"d")
-    void e27a() {}
-    @TestAnnotation3(aString = "asjdfk jkls dfjklsd fklsd jklds kflds jfkldsfj"+"dd")
-    void e27b() {}
-
-    @TestAnnotation3(aString = "a")
-    void n28a() {}
-    @TestAnnotation3(aString = "b")
-    void n28b() {}
-
-    
-    // ----- Class-----
-    @TestAnnotation3(aClazz = Void.class)
-    void e29a() {}
-    @TestAnnotation3(aClazz = Void.class)
-    void e29b() {}
-    @TestAnnotation3()
-    void e29c() {}
-    
-    @TestAnnotation3(aClazz = Integer.class)
-    void n30a() {}
-    @TestAnnotation3(aClazz = int.class)
-    void n30b() {}
-    
-    
-    // ----- Enum-----
-    @TestAnnotation3(aEnum = TestEnum1.F)
-    void e31a() {}
-    @TestAnnotation3(aEnum = TestEnum1.F)
-    void e31b() {}
-    @TestAnnotation3()
-    void e31c() {}
-    
-    @TestAnnotation3(aEnum = TestEnum1.F)
-    void n32a() {}
-    @TestAnnotation3(aEnum = TestEnum1.A)
-    void n32b() {}
-    
-    @TestAnnotation3(aEnum = TestEnum1.F)
-    void n33a() {}
-    @TestAnnotation3(aEnum = TestEnum1.L)
-    void n33b() {}
-    
-    
-    // ----- String arr-----    
-    @TestAnnotation2(arrString = {})
-    void e34a() {}
-    @TestAnnotation2(arrString = {})
-    void e34b() {}
-    @TestAnnotation2(arrString = {})
-    void e34c() {}
-
-    @TestAnnotation2(arrString = { "a", "b"})
-    void e35a() {}
-    @TestAnnotation2(arrString = { "a", "b" })
-    void e35b() {}
-
-    @TestAnnotation2(arrString = { "a", "b"})
-    void n36a() {}
-    @TestAnnotation2(arrString = { "a", "c" })
-    void n36b() {}
-
-    
-    // ----- Class arr-----    
-    @TestAnnotation2(arrClass= {})
-    void e37a() {}
-    @TestAnnotation2(arrClass = {})
-    void e37b() {}
-    @TestAnnotation2(arrClass = {})
-    void e37c() {}
-
-    @TestAnnotation2(arrClass = { Void.class, Integer.class})
-    void e38a() {}
-    @TestAnnotation2(arrClass = { Void.class, Integer.class})
-    void e38b() {}
-    
-    @TestAnnotation2(arrClass = { Void.class, Integer.class})
-    void n39a() {}
-    @TestAnnotation2(arrClass = { Void.class, int.class})
-    void n39b() {}
-
-    // ----- Enum arr-----    
-    @TestAnnotation2(arrEnum= {})
-    void e40a() {}
-    @TestAnnotation2(arrEnum = {})
-    void e40b() {}
-    @TestAnnotation2(arrEnum = {})
-    void e40c() {}
-
-    @TestAnnotation2(arrEnum = { TestEnum1.A, TestEnum1.F })
-    void e41a() {}
-    @TestAnnotation2(arrEnum = { TestEnum1.A, TestEnum1.F })
-    void e41b() {}
-    
-    @TestAnnotation2(arrEnum = { TestEnum1.A, TestEnum1.F })
-    void n42a() {}
-    @TestAnnotation2(arrEnum = { TestEnum1.A, TestEnum1.L })
-    void n42b() {}
-
-    
-    // ----- Annotation arr-----    
-    @TestAnnotation2(arrAnno= {})
-    void e43a() {}
-    @TestAnnotation2(arrAnno = {})
-    void e43b() {}
-    @TestAnnotation2()
-    void e43c() {}
-
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = 20), @TestAnnotation3(j = 123)})
-    void e44a() {}
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = 20), @TestAnnotation3(j = 123)})
-    void e44b() {}
-    
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = 20), @TestAnnotation3(j = 123)})
-    void n45a() {}
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = 20), @TestAnnotation3(j = 124)})
-    void n45b() {}
-
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = 20), @TestAnnotation3(j = 123)})
-    void n46a() {}
-    @TestAnnotation2(arrAnno = { @TestAnnotation3(i = -20), @TestAnnotation3(j = 123)})
-    void n46b() {}
-   
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
deleted file mode 100644
index 5430286..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.AnnotationTypeMismatchException;
-import java.lang.reflect.Method;
-
-/**
- * Test case of java.lang.annotation.AnnotationTypeMismatchException
- */
-@TestTargetClass(AnnotationTypeMismatchException.class) 
-public class AnnotationTypeMismatchExceptionTest extends TestCase {
-
-    /**
-     * @throws ClassNotFoundException 
-     * @throws SecurityException 
-     * @tests java.lang.annotation.AnnotationTypeMismatchException#AnnotationTypeMismatchException(Method,
-     *        String)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AnnotationTypeMismatchException",
-            args = {java.lang.reflect.Method.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "element",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "foundType",
-            args = {}
-        )
-    })
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_reflect_MethodLjava_lang_String() throws SecurityException, ClassNotFoundException {
-        Method[] methods = Class.forName("java.lang.String").getMethods();
-        Method m = methods[0];
-        AnnotationTypeMismatchException e = new AnnotationTypeMismatchException(
-                m, "some type");
-        assertNotNull("can not instantiate AnnotationTypeMismatchException", e);
-        assertSame("wrong method name", m, e.element());
-        assertEquals("wrong found type", "some type", e.foundType());
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java
deleted file mode 100644
index dec9bf7..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.ElementType;
-import java.util.Arrays;
-
-/**
- * Test case of java.lang.annotation.ElementType
- */
-@TestTargetClass(ElementType.class)
-public class ElementTypeTest extends TestCase {
-
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.ElementType#valueOf(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueOf",
-        args = {java.lang.String.class}
-    )
-    @SuppressWarnings("nls")
-    public void test_valueOfLjava_lang_String() throws Exception {
-        assertSame(ElementType.ANNOTATION_TYPE, ElementType
-                .valueOf("ANNOTATION_TYPE"));
-        assertSame(ElementType.CONSTRUCTOR, ElementType.valueOf("CONSTRUCTOR"));
-        assertSame(ElementType.FIELD, ElementType.valueOf("FIELD"));
-        assertSame(ElementType.LOCAL_VARIABLE, ElementType
-                .valueOf("LOCAL_VARIABLE"));
-        assertSame(ElementType.METHOD, ElementType.valueOf("METHOD"));
-        assertSame(ElementType.PACKAGE, ElementType.valueOf("PACKAGE"));
-        assertSame(ElementType.PARAMETER, ElementType.valueOf("PARAMETER"));
-        assertSame(ElementType.TYPE, ElementType.valueOf("TYPE"));
-        try {
-            ElementType.valueOf("OTHER");
-            fail("Should throw an IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // expected
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.ElementType#values()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
-    @SuppressWarnings("nls")
-    public void test_values() throws Exception {
-        ElementType[] values = ElementType.values();
-        assertTrue(values.length > 1);
-        Arrays.sort(values);
-        assertTrue(Arrays.binarySearch(values, ElementType.METHOD) >= 0);
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java
deleted file mode 100644
index 5c718ed..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.IncompleteAnnotationException;
-
-@TestTargetClass(IncompleteAnnotationException.class)
-public class IncompleteAnnotationExceptionTest extends TestCase {
-
-    /*
-     * Class under test for void IncompleteAnnotationException(String)
-     * Regression for HARMONY-2477
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NullPointerException.",
-        method = "IncompleteAnnotationException",
-        args = {java.lang.Class.class, java.lang.String.class}
-    )
-    public void testNullType() {
-        try {
-            new IncompleteAnnotationException(null, "str");
-            fail("NullPointerException must be thrown");
-        } catch (NullPointerException e) {
-            // Expected
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.IncompleteAnnotationException#IncompleteAnnotationException(Class,
-     *        String)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "IncompleteAnnotationException",
-            args = {java.lang.Class.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "annotationType",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "elementName",
-            args = {}
-        )
-    })
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_Class_Ljava_lang_String()
-            throws Exception {
-        Class clazz = String.class;
-        String elementName = "some element";
-        IncompleteAnnotationException e = new IncompleteAnnotationException(
-                clazz, elementName);
-        assertNotNull("can not instantiate IncompleteAnnotationException", e);
-        assertSame("wrong annotation type", clazz, e.annotationType());
-        assertSame("wrong element name", elementName, e.elementName());
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java
deleted file mode 100644
index 1827b7d..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.lang.annotation.RetentionPolicy;
-import java.util.Arrays;
-
-/**
- * Test case of java.lang.annotation.RetentionPolicy
- */
-@TestTargetClass(RetentionPolicy.class)
-public class RetentionPolicyTest extends TestCase {
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.RetentionPolicy#valueOf(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueOf",
-        args = {java.lang.String.class}
-    )
-    @SuppressWarnings("nls")
-    public void test_valueOfLjava_lang_String() throws Exception {
-        assertSame(RetentionPolicy.CLASS, RetentionPolicy
-                .valueOf("CLASS"));
-        assertSame(RetentionPolicy.RUNTIME, RetentionPolicy
-                .valueOf("RUNTIME"));
-        assertSame(RetentionPolicy.SOURCE, RetentionPolicy
-                .valueOf("SOURCE"));
-        try {
-            RetentionPolicy.valueOf("OTHER");
-            fail("Should throw an IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // expected
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.RetentionPolicy#values()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
-    @SuppressWarnings("nls")
-    public void test_values() throws Exception {
-        RetentionPolicy[] values = RetentionPolicy.values();
-        assertTrue(values.length > 1);
-        Arrays.sort(values);
-        assertTrue(Arrays.binarySearch(values, RetentionPolicy.RUNTIME) >= 0);
-    }
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation1.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation1.java
deleted file mode 100644
index 64393ef..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation1.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface TestAnnotation1 {
-    String value();
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation2.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation2.java
deleted file mode 100644
index d3c7d42..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation2.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target( {ElementType.METHOD})
-public @interface TestAnnotation2 {
-    TestAnnotation3[] arrAnno() default {};
-    String[] arrString() default {};
-    Class[] arrClass() default {};
-    TestEnum1[] arrEnum() default {};
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3.java
deleted file mode 100644
index 3228c66..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target( {ElementType.METHOD})
-public @interface TestAnnotation3 {
-    /*
-     * only primitive type, String, Class, annotation, 
-     * enumeration are permitted 
-     * or 1-dimensional arrays thereof
-     */
-    boolean z() default false;
-    byte b() default 0;
-    short s() default 0;
-    int i() default 100;
-    long j() default 0;
-    
-    float f() default 0.0f;
-    double d() default 0.0d;
-    
-    String aString() default "";
-    Class aClazz() default Void.class;
-    TestEnum1 aEnum() default TestEnum1.F;
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3b.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3b.java
deleted file mode 100644
index 5411011..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation3b.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target( {ElementType.METHOD})
-public @interface TestAnnotation3b {
-    /*
-     * only primitive type, String, Class, annotation, 
-     * enumeration are permitted 
-     * or 1-dimensional arrays thereof
-     */
-    boolean z() default false;
-    byte b() default 0;
-    short s() default 0;
-    int i() default 100;
-    long l() default 0;
-    
-    float f() default 0.0f;
-    double d() default 0.0d;
-    
-    String aString() default "";
-    Class aClazz() default Void.class;
-    TestEnum1 aEnum() default TestEnum1.F;
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation4.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation4.java
deleted file mode 100644
index 2267536..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestAnnotation4.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target( {ElementType.METHOD})
-public @interface TestAnnotation4 {
-    int i() default 0;
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1.java
deleted file mode 100644
index f8ed73d..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-public enum TestEnum1 {
-    Z, F, L, A, B
-}
diff --git a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1b.java b/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1b.java
deleted file mode 100644
index 874d893..0000000
--- a/libcore/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/TestEnum1b.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-public enum TestEnum1b {
-    Z, F, L, A, B
-}
diff --git a/libcore/annotation/src/test/java/tests/annotation/AllTests.java b/libcore/annotation/src/test/java/tests/annotation/AllTests.java
deleted file mode 100644
index 172cc10..0000000
--- a/libcore/annotation/src/test/java/tests/annotation/AllTests.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.annotation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the NIO_Char project.
- */
-public class AllTests {
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(AllTests.suite());
-    }
-
-    public static Test suite() {
-        TestSuite suite = tests.TestSuiteFactory.createTestSuite("All Annotation test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(org.apache.harmony.annotation.tests.java.lang.annotation.AllTests.suite());
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/libcore/archive/MODULE_LICENSE_APACHE2 b/libcore/archive/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/libcore/archive/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/libcore/archive/src/main/java/java/util/jar/Attributes.java b/libcore/archive/src/main/java/java/util/jar/Attributes.java
deleted file mode 100644
index adc598d..0000000
--- a/libcore/archive/src/main/java/java/util/jar/Attributes.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.harmony.archive.util.Util;
-
-/**
- * The {@code Attributes} class is used to store values for manifest entries.
- * Attribute keys are generally instances of {@code Attributes.Name}. Values
- * associated with attribute keys are of type {@code String}.
- */
-public class Attributes implements Cloneable, Map<Object, Object> {
-
-    /**
-     * The {@code Attributes} as name/value pairs. Maps the attribute names (as
-     * {@link Attributes.Name}) of a JAR file manifest to arbitrary values. The
-     * attribute names thus are obtained from the {@link Manifest} for
-     * convenience.
-     */
-    protected Map<Object, Object> map;
-
-    /**
-     * The name part of the name/value pairs constituting an attribute as
-     * defined by the specification of the JAR manifest. May be composed of the
-     * following ASCII signs as defined in the EBNF below:
-     *
-     * <pre>
-     * name       = alphanum *headerchar
-     * headerchar = alphanum | - | _
-     * alphanum   = {A-Z} | {a-z} | {0-9}
-     * </pre>
-     */
-    public static class Name {
-        private final byte[] name;
-
-        private int hashCode;
-
-        /**
-         * The class path (a main attribute).
-         */
-        public static final Name CLASS_PATH = new Name("Class-Path"); //$NON-NLS-1$
-
-        /**
-         * The version of the manifest file (a main attribute).
-         */
-        public static final Name MANIFEST_VERSION = new Name("Manifest-Version"); //$NON-NLS-1$
-
-        /**
-         * The main class's name (for stand-alone applications).
-         */
-        public static final Name MAIN_CLASS = new Name("Main-Class"); //$NON-NLS-1$
-
-        /**
-         * Defines the signature version of the JAR file.
-         */
-        public static final Name SIGNATURE_VERSION = new Name(
-                "Signature-Version"); //$NON-NLS-1$
-
-        /**
-         * The {@code Content-Type} manifest attribute.
-         */
-        public static final Name CONTENT_TYPE = new Name("Content-Type"); //$NON-NLS-1$
-
-        /**
-         * The {@code Sealed} manifest attribute which may have the value
-         * {@code true} for sealed archives.
-         */
-        public static final Name SEALED = new Name("Sealed"); //$NON-NLS-1$
-
-        /**
-         * The {@code Implementation-Title} attribute whose value is a string
-         * that defines the title of the extension implementation.
-         */
-        public static final Name IMPLEMENTATION_TITLE = new Name(
-                "Implementation-Title"); //$NON-NLS-1$
-
-        /**
-         * The {@code Implementation-Version} attribute defining the version of
-         * the extension implementation.
-         */
-        public static final Name IMPLEMENTATION_VERSION = new Name(
-                "Implementation-Version"); //$NON-NLS-1$
-
-        /**
-         * The {@code Implementation-Vendor} attribute defining the organization
-         * that maintains the extension implementation.
-         */
-        public static final Name IMPLEMENTATION_VENDOR = new Name(
-                "Implementation-Vendor"); //$NON-NLS-1$
-
-        /**
-         * The {@code Specification-Title} attribute defining the title of the
-         * extension specification.
-         */
-        public static final Name SPECIFICATION_TITLE = new Name(
-                "Specification-Title"); //$NON-NLS-1$
-
-        /**
-         * The {@code Specification-Version} attribute defining the version of
-         * the extension specification.
-         */
-        public static final Name SPECIFICATION_VERSION = new Name(
-                "Specification-Version"); //$NON-NLS-1$
-
-        /**
-         * The {@code Specification-Vendor} attribute defining the organization
-         * that maintains the extension specification.
-         */
-        public static final Name SPECIFICATION_VENDOR = new Name(
-                "Specification-Vendor"); //$NON-NLS-1$
-
-        /**
-         * The {@code Extension-List} attribute defining the extensions that are
-         * needed by the applet.
-         */
-        public static final Name EXTENSION_LIST = new Name("Extension-List"); //$NON-NLS-1$
-
-        /**
-         * The {@code Extension-Name} attribute which defines the unique name of
-         * the extension.
-         */
-        public static final Name EXTENSION_NAME = new Name("Extension-Name"); //$NON-NLS-1$
-
-        /**
-         * The {@code Extension-Installation} attribute.
-         */
-        public static final Name EXTENSION_INSTALLATION = new Name(
-                "Extension-Installation"); //$NON-NLS-1$
-
-        /**
-         * The {@code Implementation-Vendor-Id} attribute specifies the vendor
-         * of an extension implementation if the applet requires an
-         * implementation from a specific vendor.
-         */
-        public static final Name IMPLEMENTATION_VENDOR_ID = new Name(
-                "Implementation-Vendor-Id"); //$NON-NLS-1$
-
-        /**
-         * The {@code Implementation-URL} attribute specifying a URL that can be
-         * used to obtain the most recent version of the extension if the
-         * required version is not already installed.
-         */
-        public static final Name IMPLEMENTATION_URL = new Name(
-                "Implementation-URL"); //$NON-NLS-1$
-
-        static final Name NAME = new Name("Name"); //$NON-NLS-1$
-
-        /**
-         * A String which must satisfy the following EBNF grammar to specify an
-         * additional attribute:
-         *
-         * <pre>
-         * name       = alphanum *headerchar
-         * headerchar = alphanum | - | _
-         * alphanum   = {A-Z} | {a-z} | {0-9}
-         * </pre>
-         *
-         * @param s
-         *            The Attribute string.
-         * @exception IllegalArgumentException
-         *                if the string does not satisfy the EBNF grammar.
-         */
-        public Name(String s) {
-            int i = s.length();
-            if (i == 0 || i > Manifest.LINE_LENGTH_LIMIT - 2) {
-                throw new IllegalArgumentException();
-            }
-
-            name = new byte[i];
-
-            for (; --i >= 0;) {
-                char ch = s.charAt(i);
-                if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
-                        || ch == '_' || ch == '-' || (ch >= '0' && ch <= '9'))) {
-                    throw new IllegalArgumentException(s);
-                }
-                name[i] = (byte) ch;
-            }
-        }
-
-        /**
-         * A private constructor for a trusted attribute name.
-         */
-        Name(byte[] buf) {
-            name = buf;
-        }
-
-        byte[] getBytes() {
-            return name;
-        }
-
-        /**
-         * Returns this attribute name.
-         *
-         * @return the attribute name.
-         */
-        @Override
-        public String toString() {
-            try {
-                return new String(name, "ISO-8859-1"); //$NON-NLS-1$
-            } catch (UnsupportedEncodingException iee) {
-                throw new InternalError(iee.getLocalizedMessage());
-            }
-        }
-
-        /**
-         * Returns whether the argument provided is the same as the attribute
-         * name.
-         *
-         * @return if the attribute names correspond.
-         * @param object
-         *            An attribute name to be compared with this name.
-         */
-        @Override
-        public boolean equals(Object object) {
-            if (object == null || object.getClass() != getClass()
-                    || object.hashCode() != hashCode()) {
-                return false;
-            }
-
-            return Util.asciiEqualsIgnoreCase(name, ((Name) object).name);
-        }
-
-        /**
-         * Computes a hash code of the name.
-         *
-         * @return the hash value computed from the name.
-         */
-        @Override
-        public int hashCode() {
-            if (hashCode == 0) {
-                int hash = 0, multiplier = 1;
-                for (int i = name.length - 1; i >= 0; i--) {
-                    // 'A' & 0xDF == 'a' & 0xDF, ..., 'Z' & 0xDF == 'z' & 0xDF
-                    hash += (name[i] & 0xDF) * multiplier;
-                    int shifted = multiplier << 5;
-                    multiplier = shifted - multiplier;
-                }
-                hashCode = hash;
-            }
-            return hashCode;
-        }
-
-    }
-
-    /**
-     * Constructs an {@code Attributes} instance.
-     */
-    public Attributes() {
-        map = new HashMap<Object, Object>();
-    }
-
-    /**
-     * Constructs an {@code Attributes} instance obtaining keys and values from
-     * the parameter {@code attrib}.
-     *
-     * @param attrib
-     *            The attributes to obtain entries from.
-     */
-    @SuppressWarnings("unchecked")
-    public Attributes(Attributes attrib) {
-        map = (Map<Object, Object>) ((HashMap) attrib.map).clone();
-    }
-
-    /**
-     * Constructs an {@code Attributes} instance with initial capacity of size
-     * {@code size}.
-     *
-     * @param size
-     *            Initial size of this {@code Attributes} instance.
-     */
-    public Attributes(int size) {
-        map = new HashMap<Object, Object>(size);
-    }
-
-    /**
-     * Removes all key/value pairs from this {@code Attributes}.
-     */
-    public void clear() {
-        map.clear();
-    }
-
-    /**
-     * Determines whether this {@code Attributes} contains the specified key.
-     *
-     * @param key
-     *            The key to search for.
-     * @return {@code true} if the key is found, {@code false} otherwise.
-     */
-    public boolean containsKey(Object key) {
-        return map.containsKey(key);
-    }
-
-    /**
-     * Determines whether this {@code Attributes} contains the specified value.
-     *
-     * @param value
-     *            the value to search for.
-     * @return {@code true} if the value is found, {@code false} otherwise.
-     */
-    public boolean containsValue(Object value) {
-        return map.containsValue(value);
-    }
-
-    /**
-     * Returns a set containing map entries for each of the key/value pair
-     * contained in this {@code Attributes}.
-     *
-     * @return a set of Map.Entry's
-     */
-    public Set<Map.Entry<Object, Object>> entrySet() {
-        return map.entrySet();
-    }
-
-    /**
-     * Returns the value associated with the parameter key.
-     *
-     * @param key
-     *            the key to search for.
-     * @return Object associated with key, or {@code null} if key does not
-     *         exist.
-     */
-    public Object get(Object key) {
-        return map.get(key);
-    }
-
-    /**
-     * Determines whether this {@code Attributes} contains any keys.
-     *
-     * @return {@code true} if one or more keys exist, {@code false} otherwise.
-     */
-    public boolean isEmpty() {
-        return map.isEmpty();
-    }
-
-    /**
-     * Returns a {@code Set} containing all the keys found in this {@code
-     * Attributes}.
-     *
-     * @return a {@code Set} of all keys.
-     */
-    public Set<Object> keySet() {
-        return map.keySet();
-    }
-
-    /**
-     * Stores key/value pairs in this {@code Attributes}.
-     *
-     * @param key
-     *            the key to associate with value.
-     * @param value
-     *            the value to store in this {@code Attributes}.
-     * @return the value being stored.
-     * @exception ClassCastException
-     *                when key is not an {@code Attributes.Name} or value is not
-     *                a {@code String}.
-     */
-    @SuppressWarnings("cast")
-    // Require cast to force ClassCastException
-    public Object put(Object key, Object value) {
-        return map.put((Name) key, (String) value);
-    }
-
-    /**
-     * Stores all the key/value pairs in the argument in this {@code
-     * Attributes}.
-     *
-     * @param attrib
-     *            the associations to store (must be of type {@code
-     *            Attributes}).
-     */
-    public void putAll(Map<?, ?> attrib) {
-        if (attrib == null || !(attrib instanceof Attributes)) {
-            throw new ClassCastException();
-        }
-        this.map.putAll(attrib);
-    }
-
-    /**
-     * Deletes the key/value pair with key {@code key} from this {@code
-     * Attributes}.
-     *
-     * @param key
-     *            the key to remove.
-     * @return the values associated with the removed key, {@code null} if not
-     *         present.
-     */
-    public Object remove(Object key) {
-        return map.remove(key);
-    }
-
-    /**
-     * Returns the number of key/value pairs associated with this {@code
-     * Attributes}.
-     *
-     * @return the size of this {@code Attributes}.
-     */
-    public int size() {
-        return map.size();
-    }
-
-    /**
-     * Returns a collection of all the values present in this {@code
-     * Attributes}.
-     *
-     * @return a collection of all values present.
-     */
-    public Collection<Object> values() {
-        return map.values();
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public Object clone() {
-        Attributes clone;
-        try {
-            clone = (Attributes) super.clone();
-        } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
-        }
-        clone.map = (Map<Object, Object>) ((HashMap) map).clone();
-        return clone;
-    }
-
-    /**
-     * Returns the hash code of this {@code Attributes}.
-     *
-     * @return the hash code of this object.
-     */
-    @Override
-    public int hashCode() {
-        return map.hashCode();
-    }
-
-    /**
-     * Determines if this {@code Attributes} and the parameter {@code
-     * Attributes} are equal. Two {@code Attributes} instances are equal if they
-     * contain the same keys and values.
-     *
-     * @param obj
-     *            the object with which this {@code Attributes} is compared.
-     * @return {@code true} if the {@code Attributes} are equal, {@code false}
-     *         otherwise.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof Attributes) {
-            return map.equals(((Attributes) obj).map);
-        }
-        return false;
-    }
-
-    /**
-     * Returns the value associated with the parameter {@code Attributes.Name}
-     * key.
-     *
-     * @param name
-     *            the key to obtain the value for.
-     * @return the {@code String} associated with name, or {@code null} if name
-     *         is not a valid key.
-     */
-    public String getValue(Attributes.Name name) {
-        return (String) map.get(name);
-    }
-
-    /**
-     * Returns the string associated with the parameter name.
-     *
-     * @param name
-     *            the key to obtain the value for.
-     * @return the string associated with name, or {@code null} if name is not a
-     *         valid key.
-     */
-    public String getValue(String name) {
-        return (String) map.get(new Attributes.Name(name));
-    }
-
-    /**
-     * Stores the value {@code val} associated with the key {@code name} in this
-     * {@code Attributes}.
-     *
-     * @param name
-     *            the key to store.
-     * @param val
-     *            the value to store in this {@code Attributes}.
-     * @return the value being stored.
-     */
-    public String putValue(String name, String val) {
-        return (String) map.put(new Attributes.Name(name), val);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/InitManifest.java b/libcore/archive/src/main/java/java/util/jar/InitManifest.java
deleted file mode 100644
index 22baaf5..0000000
--- a/libcore/archive/src/main/java/java/util/jar/InitManifest.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.util.Map;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.luni.util.ThreadLocalCache;
-
-class InitManifest {
-
-    private byte[] buf;
-
-    private int pos;
-
-    Attributes.Name name;
-
-    String value;
-
-    CharsetDecoder decoder = ThreadLocalCache.utf8Decoder.get();
-    CharBuffer cBuf = ThreadLocalCache.charBuffer.get();
-
-    InitManifest(byte[] buf, Attributes main, Attributes.Name ver)
-            throws IOException {
-
-        this.buf = buf;
-
-        // check a version attribute
-        if (!readHeader() || (ver != null && !name.equals(ver))) {
-            throw new IOException(Messages.getString(
-                    "archive.2D", ver)); //$NON-NLS-1$
-        }
-
-        main.put(name, value);
-        while (readHeader()) {
-            main.put(name, value);
-        }
-    }
-
-    void initEntries(Map<String, Attributes> entries,
-            Map<String, Manifest.Chunk> chunks) throws IOException {
-
-        int mark = pos;
-        while (readHeader()) {
-            if (!Attributes.Name.NAME.equals(name)) {
-                throw new IOException(Messages.getString("archive.23")); //$NON-NLS-1$
-            }
-            String entryNameValue = value;
-
-            Attributes entry = entries.get(entryNameValue);
-            if (entry == null) {
-                entry = new Attributes(12);
-            }
-
-            while (readHeader()) {
-                entry.put(name, value);
-            }
-
-            if (chunks != null) {
-                if (chunks.get(entryNameValue) != null) {
-                    // TODO A bug: there might be several verification chunks for
-                    // the same name. I believe they should be used to update
-                    // signature in order of appearance; there are two ways to fix
-                    // this: either use a list of chunks, or decide on used
-                    // signature algorithm in advance and reread the chunks while
-                    // updating the signature; for now a defensive error is thrown
-                    throw new IOException(Messages.getString("archive.34")); //$NON-NLS-1$
-                }
-                chunks.put(entryNameValue, new Manifest.Chunk(mark, pos));
-                mark = pos;
-            }
-
-            entries.put(entryNameValue, entry);
-        }
-    }
-
-    int getPos() {
-        return pos;
-    }
-
-    /**
-     * Number of subsequent line breaks.
-     */
-    int linebreak = 0;
-
-    /**
-     * Read a single line from the manifest buffer.
-     */
-    private boolean readHeader() throws IOException {
-        if (linebreak > 1) {
-            // break a section on an empty line
-            linebreak = 0;
-            return false;
-        }
-        readName();
-        linebreak = 0;
-        readValue();
-        // if the last line break is missed, the line
-        // is ignored by the reference implementation
-        return linebreak > 0;
-    }
-
-    private byte[] wrap(int mark, int pos) {
-        byte[] buffer = new byte[pos - mark];
-        System.arraycopy(buf, mark, buffer, 0, pos - mark);
-        return buffer;
-    }
-
-    private void readName() throws IOException {
-        int i = 0;
-        int mark = pos;
-
-        while (pos < buf.length) {
-            byte b = buf[pos++];
-
-            if (b == ':') {
-                byte[] nameBuffer = wrap(mark, pos - 1);
-
-                if (buf[pos++] != ' ') {
-                    throw new IOException(Messages.getString(
-                            "archive.30", nameBuffer)); //$NON-NLS-1$
-                }
-
-                name = new Attributes.Name(nameBuffer);
-                return;
-            }
-
-            if (!((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_'
-                    || b == '-' || (b >= '0' && b <= '9'))) {
-                throw new IOException(Messages.getString("archive.30", b)); //$NON-NLS-1$
-            }
-        }
-        if (i > 0) {
-            throw new IOException(Messages.getString(
-                    "archive.30", wrap(mark, buf.length))); //$NON-NLS-1$
-        }
-    }
-
-    private void readValue() throws IOException {
-        byte next;
-        boolean lastCr = false;
-        int mark = pos;
-        int last = pos;
-
-        decoder.reset();
-        cBuf.clear();
-
-        while (pos < buf.length) {
-            next = buf[pos++];
-
-            switch (next) {
-            case 0:
-                throw new IOException(Messages.getString("archive.2F")); //$NON-NLS-1$
-            case '\n':
-                if (lastCr) {
-                    lastCr = false;
-                } else {
-                    linebreak++;
-                }
-                continue;
-            case '\r':
-                lastCr = true;
-                linebreak++;
-                continue;
-            case ' ':
-                if (linebreak == 1) {
-                    decode(mark, last, false);
-                    mark = pos;
-                    linebreak = 0;
-                    continue;
-                }
-            }
-
-            if (linebreak >= 1) {
-                pos--;
-                break;
-            }
-            last = pos;
-        }
-
-        decode(mark, last, true);
-        while (CoderResult.OVERFLOW == decoder.flush(cBuf)) {
-            enlargeBuffer();
-        }
-        value = new String(cBuf.array(), cBuf.arrayOffset(), cBuf.position());
-    }
-
-    private void decode(int mark, int pos, boolean endOfInput)
-            throws IOException {
-        ByteBuffer bBuf = ByteBuffer.wrap(buf, mark, pos - mark);
-        while (CoderResult.OVERFLOW == decoder.decode(bBuf, cBuf, endOfInput)) {
-            enlargeBuffer();
-        }
-    }
-
-    private void enlargeBuffer() {
-        CharBuffer newBuf = CharBuffer.allocate(cBuf.capacity() * 2);
-        newBuf.put(cBuf.array(), cBuf.arrayOffset(), cBuf.position());
-        cBuf = newBuf;
-        ThreadLocalCache.charBuffer.set(cBuf);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarEntry.java b/libcore/archive/src/main/java/java/util/jar/JarEntry.java
deleted file mode 100644
index 29d64a9..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarEntry.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.IOException;
-import java.security.CodeSigner;
-import java.security.cert.CertPath;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.zip.ZipEntry;
-
-import javax.security.auth.x500.X500Principal;
-
-/**
- * Represents a single file in a JAR archive together with the manifest
- * attributes and digital signatures associated with it.
- *
- * @see JarFile
- * @see JarInputStream
- */
-public class JarEntry extends ZipEntry {
-    private Attributes attributes;
-
-    JarFile parentJar;
-
-    CodeSigner signers[];
-
-    // Cached factory used to build CertPath-s in <code>getCodeSigners()</code>.
-    private CertificateFactory factory;
-
-    private boolean isFactoryChecked = false;
-
-    /**
-     * Creates a new {@code JarEntry} named name.
-     *
-     * @param name
-     *            The name of the new {@code JarEntry}.
-     */
-    public JarEntry(String name) {
-        super(name);
-    }
-
-    /**
-     * Creates a new {@code JarEntry} using the values obtained from entry.
-     *
-     * @param entry
-     *            The ZipEntry to obtain values from.
-     */
-    public JarEntry(ZipEntry entry) {
-        super(entry);
-    }
-
-    /**
-     * Returns the {@code Attributes} object associated with this entry or
-     * {@code null} if none exists.
-     *
-     * @return the {@code Attributes} for this entry.
-     * @exception IOException
-     *                If an error occurs obtaining the {@code Attributes}.
-     * @see Attributes
-     */
-    public Attributes getAttributes() throws IOException {
-        if (attributes != null || parentJar == null) {
-            return attributes;
-        }
-        Manifest manifest = parentJar.getManifest();
-        if (manifest == null) {
-            return null;
-        }
-        return attributes = manifest.getAttributes(getName());
-    }
-
-    /**
-     * Returns an array of {@code Certificate} Objects associated with this
-     * entry or {@code null} if none exists. Make sure that the everything is
-     * read from the input stream before calling this method, or else the method
-     * returns {@code null}.
-     *
-     * @return the certificate for this entry.
-     * @see java.security.cert.Certificate
-     */
-    public Certificate[] getCertificates() {
-        if (null == parentJar) {
-            return null;
-        }
-        JarVerifier jarVerifier = parentJar.verifier;
-        if (null == jarVerifier) {
-            return null;
-        }
-        return jarVerifier.getCertificates(getName());
-    }
-
-    void setAttributes(Attributes attrib) {
-        attributes = attrib;
-    }
-
-    /**
-     * Create a new {@code JarEntry} using the values obtained from the
-     * argument.
-     *
-     * @param je
-     *            The {@code JarEntry} to obtain values from.
-     */
-    public JarEntry(JarEntry je) {
-        super(je);
-        parentJar = je.parentJar;
-        attributes = je.attributes;
-        signers = je.signers;
-    }
-
-    /**
-     * Returns the code signers for the digital signatures associated with the
-     * JAR file. If there is no such code signer, it returns {@code null}. Make
-     * sure that the everything is read from the input stream before calling
-     * this method, or else the method returns {@code null}.
-     *
-     * @return the code signers for the JAR entry.
-     * @see CodeSigner
-     */
-    public CodeSigner[] getCodeSigners() {
-        if (null == signers) {
-            signers = getCodeSigners(getCertificates());
-        }
-        if (null == signers) {
-            return null;
-        }
-
-        CodeSigner[] tmp = new CodeSigner[signers.length];
-        System.arraycopy(signers, 0, tmp, 0, tmp.length);
-        return tmp;
-    }
-
-    private CodeSigner[] getCodeSigners(Certificate[] certs) {
-        if (null == certs) {
-            return null;
-        }
-
-        X500Principal prevIssuer = null;
-        ArrayList<Certificate> list = new ArrayList<Certificate>(certs.length);
-        ArrayList<CodeSigner> asigners = new ArrayList<CodeSigner>();
-
-        for (Certificate element : certs) {
-            if (!(element instanceof X509Certificate)) {
-                // Only X509Certificate-s are taken into account - see API spec.
-                continue;
-            }
-            X509Certificate x509 = (X509Certificate) element;
-            if (null != prevIssuer) {
-                X500Principal subj = x509.getSubjectX500Principal();
-                if (!prevIssuer.equals(subj)) {
-                    // Ok, this ends the previous chain,
-                    // so transform this one into CertPath ...
-                    addCodeSigner(asigners, list);
-                    // ... and start a new one
-                    list.clear();
-                }// else { it's still the same chain }
-
-            }
-            prevIssuer = x509.getIssuerX500Principal();
-            list.add(x509);
-        }
-        if (!list.isEmpty()) {
-            addCodeSigner(asigners, list);
-        }
-        if (asigners.isEmpty()) {
-            // 'signers' is 'null' already
-            return null;
-        }
-
-        CodeSigner[] tmp = new CodeSigner[asigners.size()];
-        asigners.toArray(tmp);
-        return tmp;
-
-    }
-
-    private void addCodeSigner(ArrayList<CodeSigner> asigners,
-            List<Certificate> list) {
-        CertPath certPath = null;
-        if (!isFactoryChecked) {
-            try {
-                factory = CertificateFactory.getInstance("X.509"); //$NON-NLS-1$
-            } catch (CertificateException ex) {
-                // do nothing
-            } finally {
-                isFactoryChecked = true;
-            }
-        }
-        if (null == factory) {
-            return;
-        }
-        try {
-            certPath = factory.generateCertPath(list);
-        } catch (CertificateException ex) {
-            // do nothing
-        }
-        if (null != certPath) {
-            asigners.add(new CodeSigner(certPath, null));
-        }
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarException.java b/libcore/archive/src/main/java/java/util/jar/JarException.java
deleted file mode 100644
index 92f61f3..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.util.zip.ZipException;
-
-/**
- * This runtime exception is thrown when a problem occurs while reading a JAR
- * file.
- */
-public class JarException extends ZipException {
-
-    private static final long serialVersionUID = 7159778400963954473L;
-
-    /**
-     * Constructs a new {@code JarException} instance.
-     */
-    public JarException() {
-        super();
-    }
-
-    /**
-     * Constructs a new {@code JarException} instance with the specified
-     * message.
-     *
-     * @param detailMessage
-     *            the detail message for the exception.
-     */
-    public JarException(String detailMessage) {
-        super(detailMessage);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarFile.java b/libcore/archive/src/main/java/java/util/jar/JarFile.java
deleted file mode 100644
index bebc82e..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarFile.java
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.File;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.archive.util.Util;
-import org.apache.harmony.luni.util.InputStreamHelper;
-
-/**
- * {@code JarFile} is used to read jar entries and their associated data from
- * jar files.
- *
- * @see JarInputStream
- * @see JarEntry
- */
-public class JarFile extends ZipFile {
-
-    /**
-     * The MANIFEST file name.
-     */
-    public static final String MANIFEST_NAME = "META-INF/MANIFEST.MF"; //$NON-NLS-1$
-
-    // The directory containing the manifest.
-    static final String META_DIR = "META-INF/"; //$NON-NLS-1$
-
-    // The manifest after it has been read from the JAR.
-    private Manifest manifest;
-
-    // The entry for the MANIFEST.MF file before it is read.
-    private ZipEntry manifestEntry;
-
-    JarVerifier verifier;
-
-    private boolean closed = false;
-
-    static final class JarFileInputStream extends FilterInputStream {
-        private long count;
-
-        private ZipEntry zipEntry;
-
-        private JarVerifier.VerifierEntry entry;
-
-        private boolean done = false;
-
-        JarFileInputStream(InputStream is, ZipEntry ze,
-                JarVerifier.VerifierEntry e) {
-            super(is);
-            zipEntry = ze;
-            count = zipEntry.getSize();
-            entry = e;
-        }
-
-        @Override
-        public int read() throws IOException {
-            if (done) {
-                return -1;
-            }
-            if (count > 0) {
-                int r = super.read();
-                if (r != -1) {
-                    entry.write(r);
-                    count--;
-                } else {
-                    count = 0;
-                }
-                if (count == 0) {
-                    done = true;
-                    entry.verify();
-                }
-                return r;
-            } else {
-                done = true;
-                entry.verify();
-                return -1;
-            }
-        }
-
-        @Override
-        public int read(byte[] buf, int off, int nbytes) throws IOException {
-            if (done) {
-                return -1;
-            }
-            if (count > 0) {
-                int r = super.read(buf, off, nbytes);
-                if (r != -1) {
-                    int size = r;
-                    if (count < size) {
-                        size = (int) count;
-                    }
-                    entry.write(buf, off, size);
-                    count -= size;
-                } else {
-                    count = 0;
-                }
-                if (count == 0) {
-                    done = true;
-                    entry.verify();
-                }
-                return r;
-            } else {
-                done = true;
-                entry.verify();
-                return -1;
-            }
-        }
-
-        @Override
-        public int available() throws IOException {
-            if (done) {
-                return 0;
-            }
-            return super.available();
-        }
-
-        @Override
-        public long skip(long nbytes) throws IOException {
-            long cnt = 0, rem = 0;
-            byte[] buf = new byte[(int)Math.min(nbytes, 2048L)];
-            while (cnt < nbytes) {
-                int x = read(buf, 0,
-                        (rem = nbytes - cnt) > buf.length ? buf.length
-                                : (int) rem);
-                if (x == -1) {
-                    return cnt;
-                }
-                cnt += x;
-            }
-            return cnt;
-        }
-    }
-
-    /**
-     * Create a new {@code JarFile} using the contents of the specified file.
-     *
-     * @param file
-     *            the JAR file as {@link File}.
-     * @throws IOException
-     *             If the file cannot be read.
-     */
-    public JarFile(File file) throws IOException {
-        this(file, true);
-    }
-
-    /**
-     * Create a new {@code JarFile} using the contents of the specified file.
-     *
-     * @param file
-     *            the JAR file as {@link File}.
-     * @param verify
-     *            if this JAR file is signed whether it must be verified.
-     * @throws IOException
-     *             If the file cannot be read.
-     */
-    public JarFile(File file, boolean verify) throws IOException {
-        super(file);
-        if (verify) {
-            verifier = new JarVerifier(file.getPath());
-        }
-        readMetaEntries();
-    }
-
-    /**
-     * Create a new {@code JarFile} using the contents of file.
-     *
-     * @param file
-     *            the JAR file as {@link File}.
-     * @param verify
-     *            if this JAR filed is signed whether it must be verified.
-     * @param mode
-     *            the mode to use, either {@link ZipFile#OPEN_READ OPEN_READ} or
-     *            {@link ZipFile#OPEN_DELETE OPEN_DELETE}.
-     * @throws IOException
-     *             If the file cannot be read.
-     */
-    public JarFile(File file, boolean verify, int mode) throws IOException {
-        super(file, mode);
-        if (verify) {
-            verifier = new JarVerifier(file.getPath());
-        }
-        readMetaEntries();
-    }
-
-    /**
-     * Create a new {@code JarFile} from the contents of the file specified by
-     * filename.
-     *
-     * @param filename
-     *            the file name referring to the JAR file.
-     * @throws IOException
-     *             if file name cannot be opened for reading.
-     */
-    public JarFile(String filename) throws IOException {
-        this(filename, true);
-    }
-
-    /**
-     * Create a new {@code JarFile} from the contents of the file specified by
-     * {@code filename}.
-     *
-     * @param filename
-     *            the file name referring to the JAR file.
-     * @param verify
-     *            if this JAR filed is signed whether it must be verified.
-     * @throws IOException
-     *             If file cannot be opened or read.
-     */
-    public JarFile(String filename, boolean verify) throws IOException {
-        super(filename);
-        if (verify) {
-            verifier = new JarVerifier(filename);
-        }
-        readMetaEntries();
-    }
-
-    /**
-     * Return an enumeration containing the {@code JarEntrys} contained in this
-     * {@code JarFile}.
-     *
-     * @return the {@code Enumeration} containing the JAR entries.
-     * @throws IllegalStateException
-     *             if this {@code JarFile} is closed.
-     */
-    @Override
-    public Enumeration<JarEntry> entries() {
-        class JarFileEnumerator implements Enumeration<JarEntry> {
-            Enumeration<? extends ZipEntry> ze;
-
-            JarFile jf;
-
-            JarFileEnumerator(Enumeration<? extends ZipEntry> zenum, JarFile jf) {
-                ze = zenum;
-                this.jf = jf;
-            }
-
-            public boolean hasMoreElements() {
-                return ze.hasMoreElements();
-            }
-
-            public JarEntry nextElement() {
-                JarEntry je = new JarEntry(ze.nextElement());
-                je.parentJar = jf;
-                return je;
-            }
-        }
-        return new JarFileEnumerator(super.entries(), this);
-    }
-
-    /**
-     * Return the {@code JarEntry} specified by its name or {@code null} if no
-     * such entry exists.
-     *
-     * @param name
-     *            the name of the entry in the JAR file.
-     * @return the JAR entry defined by the name.
-     */
-    public JarEntry getJarEntry(String name) {
-        return (JarEntry) getEntry(name);
-    }
-
-    /**
-     * Returns the {@code Manifest} object associated with this {@code JarFile}
-     * or {@code null} if no MANIFEST entry exists.
-     *
-     * @return the MANIFEST.
-     * @throws IOException
-     *             if an error occurs reading the MANIFEST file.
-     * @throws IllegalStateException
-     *             if the jar file is closed.
-     * @see Manifest
-     */
-    public Manifest getManifest() throws IOException {
-        if (closed) {
-            // archive.35=JarFile has been closed
-            throw new IllegalStateException(Messages.getString("archive.35")); //$NON-NLS-1$
-        }
-        if (manifest != null) {
-            return manifest;
-        }
-        try {
-            InputStream is = super.getInputStream(manifestEntry);
-            if (verifier != null) {
-                verifier.addMetaEntry(manifestEntry.getName(),
-                        InputStreamHelper.readFullyAndClose(is));
-                is = super.getInputStream(manifestEntry);
-            }
-            try {
-                manifest = new Manifest(is, verifier != null);
-            } finally {
-                is.close();
-            }
-            manifestEntry = null;  // Can discard the entry now.
-        } catch (NullPointerException e) {
-            manifestEntry = null;
-        }
-        return manifest;
-    }
-
-    /**
-     * Called by the JarFile constructors, this method reads the contents of the
-     * file's META-INF/ directory and picks out the MANIFEST.MF file and
-     * verifier signature files if they exist. Any signature files found are
-     * registered with the verifier.
-     * 
-     * @throws IOException
-     *             if there is a problem reading the jar file entries.
-     */
-    private void readMetaEntries() throws IOException {
-        // Get all meta directory entries
-        ZipEntry[] metaEntries = getMetaEntriesImpl();
-        if (metaEntries == null) {
-            verifier = null;
-            return;
-        }
-
-        boolean signed = false;
-
-        for (ZipEntry entry : metaEntries) {
-            String entryName = entry.getName();
-            // Is this the entry for META-INF/MANIFEST.MF ?
-            if (manifestEntry == null
-                    && Util.asciiEqualsIgnoreCase(MANIFEST_NAME, entryName)) {
-                manifestEntry = entry;
-                // If there is no verifier then we don't need to look any further.
-                if (verifier == null) {
-                    break;
-                }
-            } else {
-                // Is this an entry that the verifier needs?
-                if (verifier != null
-                        && (Util.asciiEndsWithIgnoreCase(entryName, ".SF")
-                                || Util.asciiEndsWithIgnoreCase(entryName, ".DSA")
-                                || Util.asciiEndsWithIgnoreCase(entryName, ".RSA"))) {
-                    signed = true;
-                    InputStream is = super.getInputStream(entry);
-                    byte[] buf = InputStreamHelper.readFullyAndClose(is);
-                    verifier.addMetaEntry(entryName, buf);
-                }
-            }
-        }
-
-        // If there were no signature files, then no verifier work to do.
-        if (!signed) {
-            verifier = null;
-        }
-    }
-
-    /**
-     * Return an {@code InputStream} for reading the decompressed contents of
-     * ZIP entry.
-     *
-     * @param ze
-     *            the ZIP entry to be read.
-     * @return the input stream to read from.
-     * @throws IOException
-     *             if an error occurred while creating the input stream.
-     */
-    @Override
-    public InputStream getInputStream(ZipEntry ze) throws IOException {
-        if (manifestEntry != null) {
-            getManifest();
-        }
-        if (verifier != null) {
-            verifier.setManifest(getManifest());
-            if (manifest != null) {
-                verifier.mainAttributesEnd = manifest.getMainAttributesEnd();
-            }
-            if (verifier.readCertificates()) {
-                verifier.removeMetaEntries();
-                if (manifest != null) {
-                    manifest.removeChunks();
-                }
-                if (!verifier.isSignedJar()) {
-                    verifier = null;
-                }
-            }
-        }
-        InputStream in = super.getInputStream(ze);
-        if (in == null) {
-            return null;
-        }
-        if (verifier == null || ze.getSize() == -1) {
-            return in;
-        }
-        JarVerifier.VerifierEntry entry = verifier.initEntry(ze.getName());
-        if (entry == null) {
-            return in;
-        }
-        return new JarFileInputStream(in, ze, entry);
-    }
-
-    /**
-     * Return the {@code JarEntry} specified by name or {@code null} if no such
-     * entry exists.
-     *
-     * @param name
-     *            the name of the entry in the JAR file.
-     * @return the ZIP entry extracted.
-     */
-    @Override
-    public ZipEntry getEntry(String name) {
-        ZipEntry ze = super.getEntry(name);
-        if (ze == null) {
-            return ze;
-        }
-        JarEntry je = new JarEntry(ze);
-        je.parentJar = this;
-        return je;
-    }
-
-    /**
-     * Returns all the ZipEntry's that relate to files in the
-     * JAR's META-INF directory.
-     *
-     * @return the list of ZipEntry's or {@code null} if there are none.
-     */
-    private ZipEntry[] getMetaEntriesImpl() {
-        List<ZipEntry> list = new ArrayList<ZipEntry>(8);
-        Enumeration<? extends ZipEntry> allEntries = entries();
-        while (allEntries.hasMoreElements()) {
-            ZipEntry ze = allEntries.nextElement();
-            if (ze.getName().startsWith(META_DIR)
-                    && ze.getName().length() > META_DIR.length()) {
-                list.add(ze);
-            }
-        }
-        if (list.size() == 0) {
-            return null;
-        }
-        ZipEntry[] result = new ZipEntry[list.size()];
-        list.toArray(result);
-        return result;
-    }
-
-    /**
-     * Closes this {@code JarFile}.
-     *
-     * @throws IOException
-     *             if an error occurs.
-     */
-    @Override
-    public void close() throws IOException {
-        super.close();
-        closed = true;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarInputStream.java b/libcore/archive/src/main/java/java/util/jar/JarInputStream.java
deleted file mode 100644
index 952f3f8..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarInputStream.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.apache.harmony.luni.util.Util;
-
-/**
- * The input stream from which the JAR file to be read may be fetched. It is
- * used like the {@code ZipInputStream}.
- *
- * @see ZipInputStream
- */
-public class JarInputStream extends ZipInputStream {
-
-    private Manifest manifest;
-
-    private boolean eos = false;
-
-    private JarEntry mEntry;
-
-    private JarEntry jarEntry;
-
-    private boolean isMeta;
-
-    private JarVerifier verifier;
-
-    private OutputStream verStream;
-
-    /**
-     * Constructs a new {@code JarInputStream} from an input stream.
-     *
-     * @param stream
-     *            the input stream containing the JAR file.
-     * @param verify
-     *            if the file should be verified with a {@code JarVerifier}.
-     * @throws IOException
-     *             If an error occurs reading entries from the input stream.
-     * @see ZipInputStream#ZipInputStream(InputStream)
-     */
-    public JarInputStream(InputStream stream, boolean verify)
-            throws IOException {
-        super(stream);
-        if (verify) {
-            verifier = new JarVerifier("JarInputStream"); //$NON-NLS-1$
-        }
-        if ((mEntry = getNextJarEntry()) == null) {
-            return;
-        }
-        String name = Util.toASCIIUpperCase(mEntry.getName());
-        if (name.equals(JarFile.META_DIR)) {
-            mEntry = null; // modifies behavior of getNextJarEntry()
-            closeEntry();
-            mEntry = getNextJarEntry();
-            name = mEntry.getName().toUpperCase();
-        }
-        if (name.equals(JarFile.MANIFEST_NAME)) {
-            mEntry = null;
-            manifest = new Manifest(this, verify);
-            closeEntry();
-            if (verify) {
-                verifier.setManifest(manifest);
-                if (manifest != null) {
-                    verifier.mainAttributesEnd = manifest
-                            .getMainAttributesEnd();
-                }
-            }
-
-        } else {
-            Attributes temp = new Attributes(3);
-            temp.map.put("hidden", null); //$NON-NLS-1$
-            mEntry.setAttributes(temp);
-            /*
-             * if not from the first entry, we will not get enough
-             * information,so no verify will be taken out.
-             */
-            verifier = null;
-        }
-    }
-
-    /**
-     * Constructs a new {@code JarInputStream} from an input stream.
-     *
-     * @param stream
-     *            the input stream containing the JAR file.
-     * @throws IOException
-     *             If an error occurs reading entries from the input stream.
-     * @see ZipInputStream#ZipInputStream(InputStream)
-     */
-    public JarInputStream(InputStream stream) throws IOException {
-        this(stream, true);
-    }
-
-    /**
-     * Returns the {@code Manifest} object associated with this {@code
-     * JarInputStream} or {@code null} if no manifest entry exists.
-     *
-     * @return the MANIFEST specifying the contents of the JAR file.
-     */
-    public Manifest getManifest() {
-        return manifest;
-    }
-
-    /**
-     * Returns the next {@code JarEntry} contained in this stream or {@code
-     * null} if no more entries are present.
-     *
-     * @return the next JAR entry.
-     * @throws IOException
-     *             if an error occurs while reading the entry.
-     */
-    public JarEntry getNextJarEntry() throws IOException {
-        return (JarEntry) getNextEntry();
-    }
-
-    /**
-     * Reads up to {@code length} of decompressed data and stores it in
-     * {@code buffer} starting at {@code offset}.
-     *
-     * @param buffer
-     *            Buffer to store into
-     * @param offset
-     *            offset in buffer to store at
-     * @param length
-     *            number of bytes to store
-     * @return Number of uncompressed bytes read
-     * @throws IOException
-     *             if an IOException occurs.
-     */
-    @Override
-    public int read(byte[] buffer, int offset, int length) throws IOException {
-        if (mEntry != null) {
-            return -1;
-        }
-        int r = super.read(buffer, offset, length);
-        if (verStream != null && !eos) {
-            if (r == -1) {
-                eos = true;
-                if (verifier != null) {
-                    if (isMeta) {
-                        verifier.addMetaEntry(jarEntry.getName(),
-                                ((ByteArrayOutputStream) verStream)
-                                        .toByteArray());
-                        try {
-                            verifier.readCertificates();
-                        } catch (SecurityException e) {
-                            verifier = null;
-                            throw e;
-                        }
-                    } else {
-                        ((JarVerifier.VerifierEntry) verStream).verify();
-                    }
-                }
-            } else {
-                verStream.write(buffer, offset, r);
-            }
-        }
-        return r;
-    }
-
-    /**
-     * Returns the next {@code ZipEntry} contained in this stream or {@code
-     * null} if no more entries are present.
-     *
-     * @return the next extracted ZIP entry.
-     * @throws IOException
-     *             if an error occurs while reading the entry.
-     */
-    @Override
-    public ZipEntry getNextEntry() throws IOException {
-        if (mEntry != null) {
-            jarEntry = mEntry;
-            mEntry = null;
-            jarEntry.setAttributes(null);
-        } else {
-            jarEntry = (JarEntry) super.getNextEntry();
-            if (jarEntry == null) {
-                return null;
-            }
-            if (verifier != null) {
-                isMeta = Util.toASCIIUpperCase(jarEntry.getName()).startsWith(
-                        JarFile.META_DIR);
-                if (isMeta) {
-                    verStream = new ByteArrayOutputStream();
-                } else {
-                    verStream = verifier.initEntry(jarEntry.getName());
-                }
-            }
-        }
-        eos = false;
-        return jarEntry;
-    }
-
-    @Override
-    protected ZipEntry createZipEntry(String name) {
-        JarEntry entry = new JarEntry(name);
-        if (manifest != null) {
-            entry.setAttributes(manifest.getAttributes(name));
-        }
-        return entry;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarOutputStream.java b/libcore/archive/src/main/java/java/util/jar/JarOutputStream.java
deleted file mode 100644
index 78e3aa5..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarOutputStream.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-/**
- * The {@code JarOutputStream} is used to write data in the {@code JarFile}
- * format to an arbitrary output stream
- */
-public class JarOutputStream extends ZipOutputStream {
-
-    private Manifest manifest;
-
-    /**
-     * Constructs a new {@code JarOutputStream} using an output stream. The
-     * content of the {@code Manifest} must match the JAR entry information
-     * written subsequently to the stream.
-     *
-     * @param os
-     *            the {@code OutputStream} to write to
-     * @param mf
-     *            the {@code Manifest} to output for this JAR file.
-     * @throws IOException
-     *             if an error occurs creating the {@code JarOutputStream}.
-     */
-    public JarOutputStream(OutputStream os, Manifest mf) throws IOException {
-        super(os);
-        if (mf == null) {
-            throw new NullPointerException();
-        }
-        manifest = mf;
-        ZipEntry ze = new ZipEntry(JarFile.MANIFEST_NAME);
-        putNextEntry(ze);
-        manifest.write(this);
-        closeEntry();
-    }
-
-    /**
-     * Constructs a new {@code JarOutputStream} using an arbitrary output
-     * stream.
-     *
-     * @param os
-     *            the {@code OutputStream} to write to.
-     * @throws IOException
-     *             if an error occurs creating the {@code JarOutputStream}.
-     */
-    public JarOutputStream(OutputStream os) throws IOException {
-        super(os);
-    }
-
-    /**
-     * Writes the specified ZIP entry to the underlying stream. The previous
-     * entry is closed if it is still open.
-     *
-     * @param ze
-     *            the {@code ZipEntry} to write to.
-     * @throws IOException
-     *             if an error occurs writing to the entry.
-     * @see ZipEntry
-     */
-    @Override
-    public void putNextEntry(ZipEntry ze) throws IOException {
-        super.putNextEntry(ze);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/JarVerifier.java b/libcore/archive/src/main/java/java/util/jar/JarVerifier.java
deleted file mode 100644
index 519b1e1..0000000
--- a/libcore/archive/src/main/java/java/util/jar/JarVerifier.java
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.security.GeneralSecurityException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.Certificate;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.luni.util.Base64;
-import org.apache.harmony.security.utils.JarUtils;
-
-import org.apache.harmony.luni.util.Util;
-
-// BEGIN android-added
-import org.apache.harmony.xnet.provider.jsse.OpenSSLMessageDigestJDK;
-// END android-added
-
-/**
- * Non-public class used by {@link JarFile} and {@link JarInputStream} to manage
- * the verification of signed JARs. {@code JarFile} and {@code JarInputStream}
- * objects are expected to have a {@code JarVerifier} instance member which
- * can be used to carry out the tasks associated with verifying a signed JAR.
- * These tasks would typically include:
- * <ul>
- * <li>verification of all signed signature files
- * <li>confirmation that all signed data was signed only by the party or parties
- * specified in the signature block data
- * <li>verification that the contents of all signature files (i.e. {@code .SF}
- * files) agree with the JAR entries information found in the JAR manifest.
- * </ul>
- */
-class JarVerifier {
-
-    private final String jarName;
-
-    private Manifest man;
-
-    private HashMap<String, byte[]> metaEntries = new HashMap<String, byte[]>(5);
-
-    private final Hashtable<String, HashMap<String, Attributes>> signatures = new Hashtable<String, HashMap<String, Attributes>>(
-            5);
-
-    private final Hashtable<String, Certificate[]> certificates = new Hashtable<String, Certificate[]>(
-            5);
-
-    private final Hashtable<String, Certificate[]> verifiedEntries = new Hashtable<String, Certificate[]>();
-
-    int mainAttributesEnd;
-
-    /**
-     * Stores and a hash and a message digest and verifies that massage digest
-     * matches the hash.
-     */
-    class VerifierEntry extends OutputStream {
-
-        private String name;
-
-        private MessageDigest digest;
-
-        private byte[] hash;
-
-        private Certificate[] certificates;
-
-        VerifierEntry(String name, MessageDigest digest, byte[] hash,
-                Certificate[] certificates) {
-            this.name = name;
-            this.digest = digest;
-            this.hash = hash;
-            this.certificates = certificates;
-        }
-
-        /**
-         * Updates a digest with one byte.
-         */
-        @Override
-        public void write(int value) {
-            digest.update((byte) value);
-        }
-
-        /**
-         * Updates a digest with byte array.
-         */
-        @Override
-        public void write(byte[] buf, int off, int nbytes) {
-            digest.update(buf, off, nbytes);
-        }
-
-        /**
-         * Verifies that the digests stored in the manifest match the decrypted
-         * digests from the .SF file. This indicates the validity of the
-         * signing, not the integrity of the file, as it's digest must be
-         * calculated and verified when its contents are read.
-         *
-         * @throws SecurityException
-         *             if the digest value stored in the manifest does <i>not</i>
-         *             agree with the decrypted digest as recovered from the
-         *             <code>.SF</code> file.
-         */
-        void verify() {
-            byte[] d = digest.digest();
-            if (!MessageDigest.isEqual(d, Base64.decode(hash))) {
-                throw new SecurityException(Messages.getString(
-                        "archive.32", new Object[] { //$NON-NLS-1$
-                        JarFile.MANIFEST_NAME, name, jarName }));
-            }
-            verifiedEntries.put(name, certificates);
-        }
-
-    }
-
-    /**
-     * Constructs and returns a new instance of {@code JarVerifier}.
-     *
-     * @param name
-     *            the name of the JAR file being verified.
-     */
-    JarVerifier(String name) {
-        jarName = name;
-    }
-
-    /**
-     * Invoked for each new JAR entry read operation from the input
-     * stream. This method constructs and returns a new {@link VerifierEntry}
-     * which contains the certificates used to sign the entry and its hash value
-     * as specified in the JAR MANIFEST format.
-     *
-     * @param name
-     *            the name of an entry in a JAR file which is <b>not</b> in the
-     *            {@code META-INF} directory.
-     * @return a new instance of {@link VerifierEntry} which can be used by
-     *         callers as an {@link OutputStream}.
-     */
-    VerifierEntry initEntry(String name) {
-        // If no manifest is present by the time an entry is found,
-        // verification cannot occur. If no signature files have
-        // been found, do not verify.
-        if (man == null || signatures.size() == 0) {
-            return null;
-        }
-
-        Attributes attributes = man.getAttributes(name);
-        // entry has no digest
-        if (attributes == null) {
-            return null;
-        }
-
-        Vector<Certificate> certs = new Vector<Certificate>();
-        Iterator<Map.Entry<String, HashMap<String, Attributes>>> it = signatures
-                .entrySet().iterator();
-        while (it.hasNext()) {
-            Map.Entry<String, HashMap<String, Attributes>> entry = it.next();
-            HashMap<String, Attributes> hm = entry.getValue();
-            if (hm.get(name) != null) {
-                // Found an entry for entry name in .SF file
-                String signatureFile = entry.getKey();
-
-                Vector<Certificate> newCerts = getSignerCertificates(
-                        signatureFile, certificates);
-                Iterator<Certificate> iter = newCerts.iterator();
-                while (iter.hasNext()) {
-                    certs.add(iter.next());
-                }
-            }
-        }
-
-        // entry is not signed
-        if (certs.size() == 0) {
-            return null;
-        }
-        Certificate[] certificatesArray = new Certificate[certs.size()];
-        certs.toArray(certificatesArray);
-
-        String algorithms = attributes.getValue("Digest-Algorithms"); //$NON-NLS-1$
-        if (algorithms == null) {
-            algorithms = "SHA SHA1"; //$NON-NLS-1$
-        }
-        StringTokenizer tokens = new StringTokenizer(algorithms);
-        while (tokens.hasMoreTokens()) {
-            String algorithm = tokens.nextToken();
-            String hash = attributes.getValue(algorithm + "-Digest"); //$NON-NLS-1$
-            if (hash == null) {
-                continue;
-            }
-            byte[] hashBytes;
-            try {
-                hashBytes = hash.getBytes("ISO-8859-1"); //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                throw new RuntimeException(e.toString());
-            }
-
-            try {
-                // BEGIN android-changed
-                return new VerifierEntry(name, OpenSSLMessageDigestJDK.getInstance(algorithm),
-                        hashBytes, certificatesArray);
-                // END android-changed
-            } catch (NoSuchAlgorithmException e) {
-                // ignored
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Add a new meta entry to the internal collection of data held on each JAR
-     * entry in the {@code META-INF} directory including the manifest
-     * file itself. Files associated with the signing of a JAR would also be
-     * added to this collection.
-     *
-     * @param name
-     *            the name of the file located in the {@code META-INF}
-     *            directory.
-     * @param buf
-     *            the file bytes for the file called {@code name}.
-     * @see #removeMetaEntries()
-     */
-    void addMetaEntry(String name, byte[] buf) {
-        metaEntries.put(Util.toASCIIUpperCase(name), buf);
-    }
-
-    /**
-     * If the associated JAR file is signed, check on the validity of all of the
-     * known signatures.
-     *
-     * @return {@code true} if the associated JAR is signed and an internal
-     *         check verifies the validity of the signature(s). {@code false} if
-     *         the associated JAR file has no entries at all in its {@code
-     *         META-INF} directory. This situation is indicative of an invalid
-     *         JAR file.
-     *         <p>
-     *         Will also return {@code true} if the JAR file is <i>not</i>
-     *         signed.
-     * @throws SecurityException
-     *             if the JAR file is signed and it is determined that a
-     *             signature block file contains an invalid signature for the
-     *             corresponding signature file.
-     */
-    synchronized boolean readCertificates() {
-        if (metaEntries == null) {
-            return false;
-        }
-        Iterator<String> it = metaEntries.keySet().iterator();
-        while (it.hasNext()) {
-            String key = it.next();
-            if (key.endsWith(".DSA") || key.endsWith(".RSA")) { //$NON-NLS-1$ //$NON-NLS-2$
-                verifyCertificate(key);
-                // Check for recursive class load
-                if (metaEntries == null) {
-                    return false;
-                }
-                it.remove();
-            }
-        }
-        return true;
-    }
-
-    /**
-     * @param certFile
-     */
-    private void verifyCertificate(String certFile) {
-        // Found Digital Sig, .SF should already have been read
-        String signatureFile = certFile.substring(0, certFile.lastIndexOf('.'))
-                + ".SF"; //$NON-NLS-1$
-        byte[] sfBytes = metaEntries.get(signatureFile);
-        if (sfBytes == null) {
-            return;
-        }
-
-        byte[] manifest = metaEntries.get(JarFile.MANIFEST_NAME);
-        // Manifest entry is required for any verifications.
-        if (manifest == null) {
-            return;
-        }
-
-        byte[] sBlockBytes = metaEntries.get(certFile);
-        try {
-            Certificate[] signerCertChain = JarUtils.verifySignature(
-                    new ByteArrayInputStream(sfBytes),
-                    new ByteArrayInputStream(sBlockBytes));
-            /*
-             * Recursive call in loading security provider related class which
-             * is in a signed JAR.
-             */
-            if (null == metaEntries) {
-                return;
-            }
-            if (signerCertChain != null) {
-                certificates.put(signatureFile, signerCertChain);
-            }
-        } catch (IOException e) {
-            return;
-        } catch (GeneralSecurityException e) {
-            /* [MSG "archive.31", "{0} failed verification of {1}"] */
-            throw new SecurityException(Messages.getString(
-                    "archive.31", jarName, signatureFile)); //$NON-NLS-1$
-        }
-
-        // Verify manifest hash in .sf file
-        Attributes attributes = new Attributes();
-        HashMap<String, Attributes> entries = new HashMap<String, Attributes>();
-        try {
-            InitManifest im = new InitManifest(sfBytes, attributes, Attributes.Name.SIGNATURE_VERSION);
-            im.initEntries(entries, null);
-        } catch (IOException e) {
-            return;
-        }
-
-        boolean createdBySigntool = false;
-        String createdBy = attributes.getValue("Created-By"); //$NON-NLS-1$
-        if (createdBy != null) {
-            createdBySigntool = createdBy.indexOf("signtool") != -1; //$NON-NLS-1$
-        }
-
-        // Use .SF to verify the mainAttributes of the manifest
-        // If there is no -Digest-Manifest-Main-Attributes entry in .SF
-        // file, such as those created before java 1.5, then we ignore
-        // such verification.
-        if (mainAttributesEnd > 0 && !createdBySigntool) {
-            String digestAttribute = "-Digest-Manifest-Main-Attributes"; //$NON-NLS-1$
-            if (!verify(attributes, digestAttribute, manifest, 0,
-                    mainAttributesEnd, false, true)) {
-                /* [MSG "archive.31", "{0} failed verification of {1}"] */
-                throw new SecurityException(Messages.getString(
-                        "archive.31", jarName, signatureFile)); //$NON-NLS-1$
-            }
-        }
-
-        // Use .SF to verify the whole manifest.
-        String digestAttribute = createdBySigntool ? "-Digest" //$NON-NLS-1$
-                : "-Digest-Manifest"; //$NON-NLS-1$
-        if (!verify(attributes, digestAttribute, manifest, 0, manifest.length,
-                false, false)) {
-            Iterator<Map.Entry<String, Attributes>> it = entries.entrySet()
-                    .iterator();
-            while (it.hasNext()) {
-                Map.Entry<String, Attributes> entry = it.next();
-                Manifest.Chunk chunk = man.getChunk(entry.getKey());
-                if (chunk == null) {
-                    return;
-                }
-                if (!verify(entry.getValue(), "-Digest", manifest, //$NON-NLS-1$
-                        chunk.start, chunk.end, createdBySigntool, false)) {
-                    throw new SecurityException(Messages.getString(
-                            "archive.32", //$NON-NLS-1$
-                            new Object[] { signatureFile, entry.getKey(),
-                                    jarName }));
-                }
-            }
-        }
-        metaEntries.put(signatureFile, null);
-        signatures.put(signatureFile, entries);
-    }
-
-    /**
-     * Associate this verifier with the specified {@link Manifest} object.
-     *
-     * @param mf
-     *            a {@code java.util.jar.Manifest} object.
-     */
-    void setManifest(Manifest mf) {
-        man = mf;
-    }
-
-    /**
-     * Returns a <code>boolean</code> indication of whether or not the
-     * associated jar file is signed.
-     *
-     * @return {@code true} if the JAR is signed, {@code false}
-     *         otherwise.
-     */
-    boolean isSignedJar() {
-        return certificates.size() > 0;
-    }
-
-    private boolean verify(Attributes attributes, String entry, byte[] data,
-            int start, int end, boolean ignoreSecondEndline, boolean ignorable) {
-        String algorithms = attributes.getValue("Digest-Algorithms"); //$NON-NLS-1$
-        if (algorithms == null) {
-            algorithms = "SHA SHA1"; //$NON-NLS-1$
-        }
-        StringTokenizer tokens = new StringTokenizer(algorithms);
-        while (tokens.hasMoreTokens()) {
-            String algorithm = tokens.nextToken();
-            String hash = attributes.getValue(algorithm + entry);
-            if (hash == null) {
-                continue;
-            }
-
-            MessageDigest md;
-            try {
-                // BEGIN android-changed
-                md = OpenSSLMessageDigestJDK.getInstance(algorithm);
-                // END android-changed
-            } catch (NoSuchAlgorithmException e) {
-                continue;
-            }
-            if (ignoreSecondEndline && data[end - 1] == '\n'
-                    && data[end - 2] == '\n') {
-                md.update(data, start, end - 1 - start);
-            } else {
-                md.update(data, start, end - start);
-            }
-            byte[] b = md.digest();
-            byte[] hashBytes;
-            try {
-                hashBytes = hash.getBytes("ISO-8859-1"); //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                throw new RuntimeException(e.toString());
-            }
-            return MessageDigest.isEqual(b, Base64.decode(hashBytes));
-        }
-        return ignorable;
-    }
-
-    /**
-     * Returns all of the {@link java.security.cert.Certificate} instances that
-     * were used to verify the signature on the JAR entry called
-     * {@code name}.
-     *
-     * @param name
-     *            the name of a JAR entry.
-     * @return an array of {@link java.security.cert.Certificate}.
-     */
-    Certificate[] getCertificates(String name) {
-        Certificate[] verifiedCerts = verifiedEntries.get(name);
-        if (verifiedCerts == null) {
-            return null;
-        }
-        return verifiedCerts.clone();
-    }
-
-    /**
-     * Remove all entries from the internal collection of data held about each
-     * JAR entry in the {@code META-INF} directory.
-     *
-     * @see #addMetaEntry(String, byte[])
-     */
-    void removeMetaEntries() {
-        metaEntries = null;
-    }
-
-    /**
-     * Returns a {@code Vector} of all of the
-     * {@link java.security.cert.Certificate}s that are associated with the
-     * signing of the named signature file.
-     *
-     * @param signatureFileName
-     *            the name of a signature file.
-     * @param certificates
-     *            a {@code Map} of all of the certificate chains discovered so
-     *            far while attempting to verify the JAR that contains the
-     *            signature file {@code signatureFileName}. This object is
-     *            previously set in the course of one or more calls to
-     *            {@link #verifyJarSignatureFile(String, String, String, Map, Map)}
-     *            where it was passed as the last argument.
-     * @return all of the {@code Certificate} entries for the signer of the JAR
-     *         whose actions led to the creation of the named signature file.
-     */
-    public static Vector<Certificate> getSignerCertificates(
-            String signatureFileName, Map<String, Certificate[]> certificates) {
-        Vector<Certificate> result = new Vector<Certificate>();
-        Certificate[] certChain = certificates.get(signatureFileName);
-        if (certChain != null) {
-            for (Certificate element : certChain) {
-                result.add(element);
-            }
-        }
-        return result;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/Manifest.java b/libcore/archive/src/main/java/java/util/jar/Manifest.java
deleted file mode 100644
index 48dc8c8..0000000
--- a/libcore/archive/src/main/java/java/util/jar/Manifest.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.jar;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.luni.util.InputStreamHelper;
-import org.apache.harmony.luni.util.ThreadLocalCache;
-
-/**
- * The {@code Manifest} class is used to obtain attribute information for a
- * {@code JarFile} and its entries.
- */
-public class Manifest implements Cloneable {
-    static final int LINE_LENGTH_LIMIT = 72;
-
-    private static final byte[] LINE_SEPARATOR = new byte[] { '\r', '\n' };
-
-    private static final byte[] VALUE_SEPARATOR = new byte[] { ':', ' ' };
-
-    private static final Attributes.Name NAME_ATTRIBUTE = new Attributes.Name(
-            "Name"); //$NON-NLS-1$
-
-    private Attributes mainAttributes = new Attributes();
-
-    private HashMap<String, Attributes> entries = new HashMap<String, Attributes>();
-
-    static class Chunk {
-        int start;
-        int end;
-
-        Chunk(int start, int end) {
-            this.start = start;
-            this.end = end;
-        }
-    }
-
-    private HashMap<String, Chunk> chunks;
-
-    /**
-     * Manifest bytes are used for delayed entry parsing.
-     */
-    private InitManifest im;
-
-    /**
-     * The end of the main attributes section in the manifest is needed in
-     * verification.
-     */
-    private int mainEnd;
-
-    /**
-     * Creates a new {@code Manifest} instance.
-     */
-    public Manifest() {
-        super();
-    }
-
-    /**
-     * Creates a new {@code Manifest} instance using the attributes obtained
-     * from the input stream.
-     *
-     * @param is
-     *            {@code InputStream} to parse for attributes.
-     * @throws IOException
-     *             if an IO error occurs while creating this {@code Manifest}
-     */
-    public Manifest(InputStream is) throws IOException {
-        super();
-        read(is);
-    }
-
-    /**
-     * Creates a new {@code Manifest} instance. The new instance will have the
-     * same attributes as those found in the parameter {@code Manifest}.
-     *
-     * @param man
-     *            {@code Manifest} instance to obtain attributes from.
-     */
-    @SuppressWarnings("unchecked")
-    public Manifest(Manifest man) {
-        mainAttributes = (Attributes) man.mainAttributes.clone();
-        entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
-                .getEntries()).clone();
-    }
-
-    Manifest(InputStream is, boolean readChunks) throws IOException {
-        if (readChunks) {
-            chunks = new HashMap<String, Chunk>();
-        }
-        read(is);
-    }
-
-    /**
-     * Resets the both the main attributes as well as the entry attributes
-     * associated with this {@code Manifest}.
-     */
-    public void clear() {
-        im = null;
-        entries.clear();
-        mainAttributes.clear();
-    }
-
-    /**
-     * Returns the {@code Attributes} associated with the parameter entry
-     * {@code name}.
-     *
-     * @param name
-     *            the name of the entry to obtain {@code Attributes} from.
-     * @return the Attributes for the entry or {@code null} if the entry does
-     *         not exist.
-     */
-    public Attributes getAttributes(String name) {
-        return getEntries().get(name);
-    }
-
-    /**
-     * Returns a map containing the {@code Attributes} for each entry in the
-     * {@code Manifest}.
-     *
-     * @return the map of entry attributes.
-     */
-    public Map<String, Attributes> getEntries() {
-        initEntries();
-        return entries;
-    }
-
-    private void initEntries() {
-        if (im == null) {
-            return;
-        }
-        // try {
-        // im.initEntries(entries, chunks);
-        // } catch (IOException ioe) {
-        // throw new RuntimeException(ioe);
-        // }
-        // im = null;
-    }
-
-    /**
-     * Returns the main {@code Attributes} of the {@code JarFile}.
-     *
-     * @return main {@code Attributes} associated with the source {@code
-     *         JarFile}.
-     */
-    public Attributes getMainAttributes() {
-        return mainAttributes;
-    }
-
-    /**
-     * Creates a copy of this {@code Manifest}. The returned {@code Manifest}
-     * will equal the {@code Manifest} from which it was cloned.
-     *
-     * @return a copy of this instance.
-     */
-    @Override
-    public Object clone() {
-        return new Manifest(this);
-    }
-
-    /**
-     * Writes out the attribute information of the receiver to the specified
-     * {@code OutputStream}.
-     *
-     * @param os
-     *            The {@code OutputStream} to write to.
-     * @throws IOException
-     *             If an error occurs writing the {@code Manifest}.
-     */
-    public void write(OutputStream os) throws IOException {
-        write(this, os);
-    }
-
-    /**
-     * Constructs a new {@code Manifest} instance obtaining attribute
-     * information from the specified input stream.
-     *
-     * @param is
-     *            The {@code InputStream} to read from.
-     * @throws IOException
-     *             If an error occurs reading the {@code Manifest}.
-     */
-    public void read(InputStream is) throws IOException {
-        byte[] buf;
-        // Try to read get a reference to the bytes directly
-        try {
-            buf = InputStreamHelper.expose(is);
-        } catch (UnsupportedOperationException uoe) {
-            buf = readFully(is);
-        }
-
-        if (buf.length == 0) {
-            return;
-        }
-
-        // a workaround for HARMONY-5662
-        // replace EOF and NUL with another new line
-        // which does not trigger an error
-        byte b = buf[buf.length - 1];
-        if (0 == b || 26 == b) {
-            buf[buf.length - 1] = '\n';
-        }
-
-        // Attributes.Name.MANIFEST_VERSION is not used for
-        // the second parameter for RI compatibility
-        im = new InitManifest(buf, mainAttributes, null);
-        mainEnd = im.getPos();
-        // FIXME
-        im.initEntries(entries, chunks);
-        im = null;
-    }
-
-    /*
-     * Helper to read the entire contents of the manifest from the
-     * given input stream.  Usually we can do this in a single read
-     * but we need to account for 'infinite' streams, by ensuring we
-     * have a line feed within a reasonable number of characters.
-     */
-    private byte[] readFully(InputStream is) throws IOException {
-        // Initial read
-        byte[] buffer = new byte[4096];
-        int count = is.read(buffer);
-        int nextByte = is.read();
-
-        // Did we get it all in one read?
-        if (nextByte == -1) {
-            byte[] dest = new byte[count];
-            System.arraycopy(buffer, 0, dest, 0, count);
-            return dest;
-        }
-
-        // Does it look like a manifest?
-        if (!containsLine(buffer, count)) {
-            // archive.2E=Manifest is too long
-            throw new IOException(Messages.getString("archive.2E")); //$NON-NLS-1$
-        }
-
-        // Requires additional reads
-        ByteArrayOutputStream baos = new ByteArrayOutputStream(count * 2);
-        baos.write(buffer, 0, count);
-        baos.write(nextByte);
-        while (true) {
-            count = is.read(buffer);
-            if (count == -1) {
-                return baos.toByteArray();
-            }
-            baos.write(buffer, 0, count);
-        }
-    }
-
-    /*
-     * Check to see if the buffer contains a newline or carriage
-     * return character within the first 'length' bytes.  Used to
-     * check the validity of the manifest input stream.
-     */
-    private boolean containsLine(byte[] buffer, int length) {
-        for (int i = 0; i < length; i++) {
-            if (buffer[i] == 0x0A || buffer[i] == 0x0D) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns the hash code for this instance.
-     *
-     * @return this {@code Manifest}'s hashCode.
-     */
-    @Override
-    public int hashCode() {
-        return mainAttributes.hashCode() ^ getEntries().hashCode();
-    }
-
-    /**
-     * Determines if the receiver is equal to the parameter object. Two {@code
-     * Manifest}s are equal if they have identical main attributes as well as
-     * identical entry attributes.
-     *
-     * @param o
-     *            the object to compare against.
-     * @return {@code true} if the manifests are equal, {@code false} otherwise
-     */
-    @Override
-    public boolean equals(Object o) {
-        if (o == null) {
-            return false;
-        }
-        if (o.getClass() != this.getClass()) {
-            return false;
-        }
-        if (!mainAttributes.equals(((Manifest) o).mainAttributes)) {
-            return false;
-        }
-        return getEntries().equals(((Manifest) o).getEntries());
-    }
-
-    Chunk getChunk(String name) {
-        return chunks.get(name);
-    }
-
-    void removeChunks() {
-        chunks = null;
-    }
-
-    int getMainAttributesEnd() {
-        return mainEnd;
-    }
-
-    /**
-     * Writes out the attribute information of the specified manifest to the
-     * specified {@code OutputStream}
-     *
-     * @param manifest
-     *            the manifest to write out.
-     * @param out
-     *            The {@code OutputStream} to write to.
-     * @throws IOException
-     *             If an error occurs writing the {@code Manifest}.
-     */
-    static void write(Manifest manifest, OutputStream out) throws IOException {
-        CharsetEncoder encoder = ThreadLocalCache.utf8Encoder.get();
-        ByteBuffer buffer = ThreadLocalCache.byteBuffer.get();
-
-        String version = manifest.mainAttributes
-                .getValue(Attributes.Name.MANIFEST_VERSION);
-        if (version != null) {
-            writeEntry(out, Attributes.Name.MANIFEST_VERSION, version, encoder,
-                    buffer);
-            Iterator<?> entries = manifest.mainAttributes.keySet().iterator();
-            while (entries.hasNext()) {
-                Attributes.Name name = (Attributes.Name) entries.next();
-                if (!name.equals(Attributes.Name.MANIFEST_VERSION)) {
-                    writeEntry(out, name, manifest.mainAttributes
-                            .getValue(name), encoder, buffer);
-                }
-            }
-        }
-        out.write(LINE_SEPARATOR);
-        Iterator<String> i = manifest.getEntries().keySet().iterator();
-        while (i.hasNext()) {
-            String key = i.next();
-            writeEntry(out, NAME_ATTRIBUTE, key, encoder, buffer);
-            Attributes attrib = manifest.entries.get(key);
-            Iterator<?> entries = attrib.keySet().iterator();
-            while (entries.hasNext()) {
-                Attributes.Name name = (Attributes.Name) entries.next();
-                writeEntry(out, name, attrib.getValue(name), encoder, buffer);
-            }
-            out.write(LINE_SEPARATOR);
-        }
-    }
-
-    private static void writeEntry(OutputStream os, Attributes.Name name,
-            String value, CharsetEncoder encoder, ByteBuffer bBuf)
-            throws IOException {
-        byte[] out = name.getBytes();
-        if (out.length > LINE_LENGTH_LIMIT) {
-            throw new IOException(Messages.getString(
-                    "archive.33", name, Integer.valueOf(LINE_LENGTH_LIMIT))); //$NON-NLS-1$
-        }
-
-        os.write(out);
-        os.write(VALUE_SEPARATOR);
-
-        encoder.reset();
-        bBuf.clear().limit(LINE_LENGTH_LIMIT - out.length - 2);
-
-        CharBuffer cBuf = CharBuffer.wrap(value);
-        CoderResult r;
-
-        while (true) {
-            r = encoder.encode(cBuf, bBuf, true);
-            if (CoderResult.UNDERFLOW == r) {
-                r = encoder.flush(bBuf);
-            }
-            os.write(bBuf.array(), bBuf.arrayOffset(), bBuf.position());
-            os.write(LINE_SEPARATOR);
-            if (CoderResult.UNDERFLOW == r) {
-                break;
-            }
-            os.write(' ');
-            bBuf.clear().limit(LINE_LENGTH_LIMIT - 1);
-        }
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/Pack200.java b/libcore/archive/src/main/java/java/util/jar/Pack200.java
deleted file mode 100644
index 9cb045e..0000000
--- a/libcore/archive/src/main/java/java/util/jar/Pack200.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package java.util.jar;
-
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.SortedMap;
-
-/**
- * Class factory for {@link Pack200.Packer} and {@link Pack200.Unpacker}.
- */
-public abstract class Pack200 {
-
-    private static final String SYSTEM_PROPERTY_PACKER = "java.util.jar.Pack200.Packer"; //$NON-NLS-1$
-
-    private static final String SYSTEM_PROPERTY_UNPACKER = "java.util.jar.Pack200.Unpacker"; //$NON-NLS-1$
-
-    /**
-     * Prevent this class from being instantiated.
-     */
-    private Pack200() {
-        // do nothing
-    }
-
-    /**
-     * Returns a new instance of a packer engine.
-     * <p>
-     * The implementation of the packer engine is defined by the system property
-     * {@code 'java.util.jar.Pack200.Packer'}. If this system property is
-     * defined an instance of the specified class is returned, otherwise the
-     * system's default implementation is returned.
-     *
-     * @return an instance of {@code Packer}
-     */
-    public static Pack200.Packer newPacker() {
-        return (Packer) AccessController
-                .doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        String className = System
-                                .getProperty(SYSTEM_PROPERTY_PACKER,
-                                        "org.apache.harmony.pack200.Pack200PackerAdapter"); //$NON-NLS-1$
-                        try {
-                            // TODO Not sure if this will cause problems with
-                            // loading the packer
-                            return ClassLoader.getSystemClassLoader()
-                                    .loadClass(className).newInstance();
-                        } catch (Exception e) {
-                            throw new Error("Can't load class " + className, e);
-                        }
-                    }
-                });
-
-    }
-
-    /**
-     * Returns a new instance of a unpacker engine.
-     * <p>
-     * The implementation of the unpacker engine is defined by the system
-     * property {@code 'java.util.jar.Pack200.Unpacker'}. If this system
-     * property is defined an instance of the specified class is returned,
-     * otherwise the system's default implementation is returned.
-     *
-     * @return a instance of {@code Unpacker}.
-     */
-    public static Pack200.Unpacker newUnpacker() {
-        return (Unpacker) AccessController
-                .doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        String className = System
-                                .getProperty(SYSTEM_PROPERTY_UNPACKER,
-                                        "org.apache.harmony.unpack200.Pack200UnpackerAdapter");//$NON-NLS-1$
-                        try {
-                            return ClassLoader.getSystemClassLoader()
-                                    .loadClass(className).newInstance();
-                        } catch (Exception e) {
-                            throw new Error("Can't load class " + className, e);
-                        }
-                    }
-                });
-    }
-
-    /**
-     * The interface defining the API for converting a JAR file to an output
-     * stream in the Pack200 format.
-     */
-    public static interface Packer {
-
-        /**
-         * the format of a class attribute name.
-         */
-        static final String CLASS_ATTRIBUTE_PFX = "pack.class.attribute."; //$NON-NLS-1$
-
-        /**
-         * the format of a code attribute name.
-         */
-        static final String CODE_ATTRIBUTE_PFX = "pack.code.attribute."; //$NON-NLS-1$
-
-        /**
-         * the deflation hint to set in the output archive.
-         */
-        static final String DEFLATE_HINT = "pack.deflate.hint";//$NON-NLS-1$
-
-        /**
-         * the indicated amount of effort to use in compressing the archive.
-         */
-        static final String EFFORT = "pack.effort";//$NON-NLS-1$
-
-        /**
-         * a String representation for {@code error}.
-         */
-        static final String ERROR = "error";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code false}.
-         */
-        static final String FALSE = "false";//$NON-NLS-1$
-
-        /**
-         * the format of a field attribute name.
-         */
-        static final String FIELD_ATTRIBUTE_PFX = "pack.field.attribute.";//$NON-NLS-1$
-
-        /**
-         * a String representation for {@code keep}.
-         */
-        static final String KEEP = "keep";//$NON-NLS-1$
-
-        /**
-         * decide if all elements shall transmit in their original order.
-         */
-        static final String KEEP_FILE_ORDER = "pack.keep.file.order";//$NON-NLS-1$
-
-        /**
-         * a String representation for {@code latest}.
-         */
-        static final String LATEST = "latest";//$NON-NLS-1$
-
-        /**
-         * the format of a method attribute name.
-         */
-        static final String METHOD_ATTRIBUTE_PFX = "pack.method.attribute.";//$NON-NLS-1$
-
-        /**
-         * if it shall attempt to determine the latest modification time if this
-         * is set to {@code LATEST}.
-         */
-        static final String MODIFICATION_TIME = "pack.modification.time";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code pass}.
-         */
-        static final String PASS = "pass";//$NON-NLS-1$
-
-        /**
-         * the file that will not be compressed.
-         */
-        static final String PASS_FILE_PFX = "pack.pass.file.";//$NON-NLS-1$
-
-        /**
-         * packer progress as a percentage.
-         */
-        static final String PROGRESS = "pack.progress";//$NON-NLS-1$
-
-        /**
-         * The number of bytes of each archive segment.
-         */
-        static final String SEGMENT_LIMIT = "pack.segment.limit";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code strip}.
-         */
-        static final String STRIP = "strip";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code true}.
-         */
-        static final String TRUE = "true";//$NON-NLS-1$
-
-        /**
-         * the action to take if an unknown attribute is encountered.
-         */
-        static final String UNKNOWN_ATTRIBUTE = "pack.unknown.attribute";//$NON-NLS-1$
-
-        /**
-         * Returns a sorted map of the properties of this packer.
-         *
-         * @return the properties of the packer.
-         */
-        SortedMap<String, String> properties();
-
-        /**
-         * Pack the specified JAR file to the specified output stream.
-         *
-         * @param in
-         *            JAR file to be compressed.
-         * @param out
-         *            stream of compressed data.
-         * @throws IOException
-         *             if I/O exception occurs.
-         */
-        void pack(JarFile in, OutputStream out) throws IOException;
-
-        /**
-         * Pack the data from the specified jar input stream to the specified
-         * output stream.
-         *
-         * @param in
-         *            stream of uncompressed JAR data.
-         * @param out
-         *            stream of compressed data.
-         * @throws IOException
-         *             if I/O exception occurs.
-         */
-        void pack(JarInputStream in, OutputStream out) throws IOException;
-
-        /**
-         * add a listener for PropertyChange events
-         *
-         * @param listener
-         *            the listener to listen if PropertyChange events occurs
-         */
-        void addPropertyChangeListener(PropertyChangeListener listener);
-
-        /**
-         * remove a listener
-         *
-         * @param listener
-         *            listener to remove
-         */
-        void removePropertyChangeListener(PropertyChangeListener listener);
-    }
-
-    /**
-     * The interface defining the API for converting a packed stream in the
-     * Pack200 format to a JAR file.
-     */
-    public static interface Unpacker {
-
-        /**
-         * The String indicating if the unpacker should ignore all transmitted
-         * values,can be replaced by either {@code true} or {@code false}.
-         */
-        static final String DEFLATE_HINT = "unpack.deflate.hint";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code false}.
-         */
-        static final String FALSE = "false";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code keep}.
-         */
-        static final String KEEP = "keep";//$NON-NLS-1$
-
-        /**
-         * the progress as a {@code percentage}.
-         */
-        static final String PROGRESS = "unpack.progress";//$NON-NLS-1$
-
-        /**
-         * a String representation of {@code true}.
-         */
-        static final String TRUE = "true";//$NON-NLS-1$
-
-        /**
-         * Returns a sorted map of the properties of this unpacker.
-         *
-         * @return the properties of unpacker.
-         */
-        SortedMap<String, String> properties();
-
-        /**
-         * Unpack the specified stream to the specified JAR output stream.
-         *
-         * @param in
-         *            stream to uncompressed.
-         * @param out
-         *            JAR output stream of uncompressed data.
-         * @throws IOException
-         *             if I/O exception occurs.
-         */
-        void unpack(InputStream in, JarOutputStream out) throws IOException;
-
-        /**
-         * Unpack the contents of the specified {@code File} to the specified
-         * JAR output stream.
-         *
-         * @param in
-         *            file to be uncompressed.
-         * @param out
-         *            JAR output stream of uncompressed data.
-         * @throws IOException
-         *             if I/O exception occurs.
-         */
-        void unpack(File in, JarOutputStream out) throws IOException;
-
-        /**
-         * add a listener for {@code PropertyChange} events.
-         *
-         * @param listener
-         *            the listener to listen if {@code PropertyChange} events
-         *            occurs.
-         */
-        void addPropertyChangeListener(PropertyChangeListener listener);
-
-        /**
-         * remove a listener.
-         *
-         * @param listener
-         *            listener to remove.
-         */
-        void removePropertyChangeListener(PropertyChangeListener listener);
-    }
-
-}
diff --git a/libcore/archive/src/main/java/java/util/jar/package.html b/libcore/archive/src/main/java/java/util/jar/package.html
deleted file mode 100644
index 35eabe7..0000000
--- a/libcore/archive/src/main/java/java/util/jar/package.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<html>
-  <body>
-    <p>
-      The java.jar package gives access to reading and writing a Java archive, 
-      or JAR, files. These are
-      actually ZIP files with the possibility to add meta-information in the 
-      form of a MANIFEST file. This manifest can also be used
-      to sign a JAR file.
-    </p>
-    @since Android 1.0
-  </body>
-</html>
diff --git a/libcore/archive/src/main/java/java/util/zip/Adler32.java b/libcore/archive/src/main/java/java/util/zip/Adler32.java
deleted file mode 100644
index ebdc996..0000000
--- a/libcore/archive/src/main/java/java/util/zip/Adler32.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-/**
- * The Adler-32 class is used to compute the {@code Adler32} checksum from a set
- * of data. Compared to the CRC-32 algorithm it trades reliabilty for speed.
- * Refer to RFC 1950 for the specification.
- *
- * @see CRC32
- */
-public class Adler32 implements java.util.zip.Checksum {
-
-    private long adler = 1;
-
-    /**
-     * Returns the {@code Adler32} checksum for all input received.
-     *
-     * @return The checksum for this instance.
-     */
-    public long getValue() {
-        return adler;
-    }
-
-    /**
-     * Reset this instance to its initial checksum.
-     */
-    public void reset() {
-        adler = 1;
-    }
-
-    /**
-     * Update this {@code Adler32} checksum with the single byte provided as
-     * argument.
-     *
-     * @param i
-     *            the byte to update checksum with.
-     */
-    public void update(int i) {
-        adler = updateByteImpl(i, adler);
-    }
-
-    /**
-     * Update this {@code Adler32} checksum using the contents of {@code buf}.
-     *
-     * @param buf
-     *            bytes to update checksum with.
-     */
-    public void update(byte[] buf) {
-        update(buf, 0, buf.length);
-    }
-
-    /**
-     * Update this {@code Adler32} checksum with the contents of {@code buf},
-     * starting from the offset provided and reading n bytes of data.
-     *
-     * @param buf
-     *            buffer to obtain data from.
-     * @param off
-     *            offset in {@code buf} to start reading from.
-     * @param nbytes
-     *            number of bytes from {@code buf} to use.
-     * @throws ArrayIndexOutOfBoundsException
-     *             if {@code offset > buf.length} or {@code nbytes} is negative
-     *             or {@code offset + nbytes > buf.length}.
-     */
-    public void update(byte[] buf, int off, int nbytes) {
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            adler = updateImpl(buf, off, nbytes, adler);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    private native long updateImpl(byte[] buf, int off, int nbytes, long adler1);
-
-    private native long updateByteImpl(int val, long adler1);
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/CRC32.java b/libcore/archive/src/main/java/java/util/zip/CRC32.java
deleted file mode 100644
index 8fc6bb7..0000000
--- a/libcore/archive/src/main/java/java/util/zip/CRC32.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-/**
- * The CRC32 class is used to compute a CRC32 checksum from data provided as
- * input value.
- */
-public class CRC32 implements java.util.zip.Checksum {
-
-    private long crc = 0L;
-
-    long tbytes = 0L;
-
-    /**
-     * Returns the CRC32 checksum for all input received.
-     *
-     * @return The checksum for this instance.
-     */
-    public long getValue() {
-        return crc;
-    }
-
-    /**
-     * Resets the CRC32 checksum to it initial state.
-     */
-    public void reset() {
-        tbytes = crc = 0;
-
-    }
-
-    /**
-     * Updates this checksum with the byte value provided as integer.
-     *
-     * @param val
-     *            represents the byte to update the checksum.
-     */
-    public void update(int val) {
-        crc = updateByteImpl((byte) val, crc);
-    }
-
-    /**
-     * Updates this checksum with the bytes contained in buffer {@code buf}.
-     *
-     * @param buf
-     *            the buffer holding the data to update the checksum with.
-     */
-    public void update(byte[] buf) {
-        update(buf, 0, buf.length);
-    }
-
-    /**
-     * Updates this checksum with n bytes of data obtained from buffer {@code
-     * buf}, starting at offset {@code off}.
-     *
-     * @param buf
-     *            the buffer to update the checksum.
-     * @param off
-     *            the offset in {@code buf} to obtain data from.
-     * @param nbytes
-     *            the number of bytes to read from {@code buf}.
-     */
-    public void update(byte[] buf, int off, int nbytes) {
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            tbytes += nbytes;
-            crc = updateImpl(buf, off, nbytes, crc);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    private native long updateImpl(byte[] buf, int off, int nbytes, long crc1);
-
-    private native long updateByteImpl(byte val, long crc1);
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/CheckedInputStream.java b/libcore/archive/src/main/java/java/util/zip/CheckedInputStream.java
deleted file mode 100644
index 4805ef7..0000000
--- a/libcore/archive/src/main/java/java/util/zip/CheckedInputStream.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * The {@code CheckedInputStream} class is used to maintain a checksum at the
- * same time as the data, on which the checksum is computed, is read from a
- * stream. The purpose of this checksum is to establish data integrity,
- * comparing the computed checksum against a published checksum value.
- */
-public class CheckedInputStream extends java.io.FilterInputStream {
-
-    private final Checksum check;
-
-    /**
-     * Constructs a new {@code CheckedInputStream} on {@code InputStream}
-     * {@code is}. The checksum will be calculated using the algorithm
-     * implemented by {@code csum}.
-     *
-     * @param is
-     *            the input stream to calculate checksum from.
-     * @param csum
-     *            an entity implementing the checksum algorithm.
-     */
-    public CheckedInputStream(InputStream is, Checksum csum) {
-        super(is);
-        check = csum;
-    }
-
-    /**
-     * Reads one byte of data from the underlying input stream and updates the
-     * checksum with the byte data.
-     *
-     * @return {@code -1} at the end of the stream, a single byte value
-     *         otherwise.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    @Override
-    public int read() throws IOException {
-        int x = in.read();
-        if (x != -1) {
-            check.update(x);
-        }
-        return x;
-    }
-
-    /**
-     * Reads up to n bytes of data from the underlying input stream, storing it
-     * into {@code buf}, starting at offset {@code off}. The checksum is
-     * updated with the bytes read.
-     *
-     * @param buf
-     *            the byte array in which to store the bytes read.
-     * @param off
-     *            the initial position in {@code buf} to store the bytes read
-     *            from this stream.
-     * @param nbytes
-     *            the maximum number of bytes to store in {@code buf}.
-     * @return the number of bytes actually read or {@code -1} if arrived at the
-     *         end of the filtered stream while reading the data.
-     * @throws IOException
-     *             if this stream is closed or some I/O error occurs.
-     */
-    @Override
-    public int read(byte[] buf, int off, int nbytes) throws IOException {
-        int x = in.read(buf, off, nbytes);
-        if (x != -1) {
-            check.update(buf, off, x);
-        }
-        return x;
-    }
-
-    /**
-     * Returns the checksum calculated on the stream read so far.
-     *
-     * @return the updated checksum.
-     */
-    public Checksum getChecksum() {
-        return check;
-    }
-
-    /**
-     * Skip up to n bytes of data on the underlying input stream. Any skipped
-     * bytes are added to the running checksum value.
-     *
-     * @param nbytes
-     *            the number of bytes to skip.
-     * @throws IOException
-     *             if this stream is closed or another I/O error occurs.
-     * @return the number of bytes skipped.
-     */
-    @Override
-    public long skip(long nbytes) throws IOException {
-        if (nbytes < 1) {
-            return 0;
-        }
-        long skipped = 0;
-        byte[] b = new byte[(int)Math.min(nbytes, 2048L)];
-        int x, v;
-        while (skipped != nbytes) {
-            x = in.read(b, 0,
-                    (v = (int) (nbytes - skipped)) > b.length ? b.length : v);
-            if (x == -1) {
-                return skipped;
-            }
-            check.update(b, 0, x);
-            skipped += x;
-        }
-        return skipped;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/CheckedOutputStream.java b/libcore/archive/src/main/java/java/util/zip/CheckedOutputStream.java
deleted file mode 100644
index 3c19726..0000000
--- a/libcore/archive/src/main/java/java/util/zip/CheckedOutputStream.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * The {@code CheckedOutputStream} class is used to maintain a running checksum
- * of all data written to a stream. The purpose of this checksum is to establish
- * data integrity, by publishing the checksum to other parties wanting to read
- * the non corrupted data.
- */
-public class CheckedOutputStream extends java.io.FilterOutputStream {
-
-    private final Checksum check;
-
-    /**
-     * Constructs a new {@code CheckedOutputStream} on {@code OutputStream}
-     * {@code os}. The checksum is calculated using the algorithm implemented
-     * by {@code csum}.
-     *
-     * @param os
-     *            the output stream to calculate checksum for.
-     * @param cs
-     *            an entity implementing the checksum algorithm.
-     */
-    public CheckedOutputStream(OutputStream os, Checksum cs) {
-        super(os);
-        check = cs;
-    }
-
-    /**
-     * Returns the checksum calculated on the stream read so far.
-     *
-     * @return the updated checksum.
-     */
-    public Checksum getChecksum() {
-        return check;
-    }
-
-    /**
-     * Writes the specified byte to the underlying stream. The checksum is
-     * updated with {@code val}.
-     *
-     * @param val
-     *            the data value to written to the output stream.
-     * @throws IOException
-     *             if an IO error has occurred.
-     */
-    @Override
-    public void write(int val) throws IOException {
-        out.write(val);
-        check.update(val);
-    }
-
-    /**
-     * Writes n bytes of data from {@code buf} starting at offset {@code off} to
-     * the underlying stream. The checksum is updated with the bytes written.
-     *
-     * @param buf
-     *            data written to the output stream.
-     * @param off
-     *            the offset to start reading the data from {@code buf} written
-     *            to the output stream.
-     * @param nbytes
-     *            number of bytes to write to the output stream.
-     * @throws IOException
-     *             if an IO error has occurred.
-     */
-    @Override
-    public void write(byte[] buf, int off, int nbytes) throws IOException {
-        out.write(buf, off, nbytes);
-        check.update(buf, off, nbytes);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/Checksum.java b/libcore/archive/src/main/java/java/util/zip/Checksum.java
deleted file mode 100644
index fac7e4e..0000000
--- a/libcore/archive/src/main/java/java/util/zip/Checksum.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-/**
- * Holds information about a checksum which was computed with the methods
- * implementing a checksum algorithm.
- */
-public interface Checksum {
-
-    /**
-     * Returns the current calculated checksum value.
-     *
-     * @return the checksum.
-     */
-    public long getValue();
-
-    /**
-     * Resets the checksum value applied before beginning calculations on a new
-     * stream of data.
-     */
-    public void reset();
-
-    /**
-     * Updates the checksum with the given bytes.
-     *
-     * @param buf
-     *            the byte array from which to read the bytes.
-     * @param off
-     *            the initial position in {@code buf} to read the bytes from.
-     * @param nbytes
-     *            the number of bytes to read from {@code buf}.
-     */
-    public void update(byte[] buf, int off, int nbytes);
-
-    /**
-     * Updates the checksum value with the given byte.
-     *
-     * @param val
-     *            the byte to update the checksum with.
-     */
-    public void update(int val);
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/DataFormatException.java b/libcore/archive/src/main/java/java/util/zip/DataFormatException.java
deleted file mode 100644
index ec4e867..0000000
--- a/libcore/archive/src/main/java/java/util/zip/DataFormatException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-/**
- * {@code DataFormatException} is used to indicate an error in the format of a
- * particular data stream which is to be uncompressed.
- */
-public class DataFormatException extends Exception {
-
-    private static final long serialVersionUID = 2219632870893641452L;
-
-    /**
-     * Constructs a new {@code DataFormatException} instance.
-     */
-    public DataFormatException() {
-        super();
-    }
-
-    /**
-     * Constructs a new {@code DataFormatException} instance with the specified
-     * message.
-     *
-     * @param detailMessage
-     *            the detail message for the exception.
-     */
-    public DataFormatException(String detailMessage) {
-        super(detailMessage);
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/Deflater.java b/libcore/archive/src/main/java/java/util/zip/Deflater.java
deleted file mode 100644
index 41a337c..0000000
--- a/libcore/archive/src/main/java/java/util/zip/Deflater.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-
-/**
- * This class compresses data using the <i>DEFLATE</i> algorithm (see <a
- * href="http://www.gzip.org/algorithm.txt">specification</a>).
- * <p>
- * Basically this class is part of the API to the stream based ZLIB compression
- * library and is used as such by {@code DeflaterOutputStream} and its
- * descendants.
- * <p>
- * The typical usage of a {@code Deflater} instance outside this package
- * consists of a specific call to one of its constructors before being passed to
- * an instance of {@code DeflaterOutputStream}.
- *
- * @see DeflaterOutputStream
- * @see Inflater
- */
-public class Deflater {
-
-    /**
-     * Upper bound for the compression level range.
-     */
-    public static final int BEST_COMPRESSION = 9;
-
-    /**
-     * Lower bound for compression level range.
-     */
-    public static final int BEST_SPEED = 1;
-
-    /**
-     * Usage of the default compression level.
-     */
-    public static final int DEFAULT_COMPRESSION = -1;
-
-    /**
-     * Default value for compression strategy.
-     */
-    public static final int DEFAULT_STRATEGY = 0;
-
-    /**
-     * Default value for compression method.
-     */
-    public static final int DEFLATED = 8;
-
-    /**
-     * Possible value for compression strategy.
-     */
-    public static final int FILTERED = 1;
-
-    /**
-     * Possible value for compression strategy.
-     */
-    public static final int HUFFMAN_ONLY = 2;
-
-    /**
-     * Possible value for compression level.
-     */
-    public static final int NO_COMPRESSION = 0;
-
-    /**
-     * Use buffering for best compression.
-     *
-     * @hide
-     * @since 1.7
-     */
-    public static final int NO_FLUSH = 0;
-
-    /**
-     * Flush buffers so recipients can immediately decode the data sent thus
-     * far. This mode may degrade compression.
-     *
-     * @hide
-     * @since 1.7
-     */
-    public static final int SYNC_FLUSH = 2;
-
-    /**
-     * Flush buffers so recipients can immediately decode the data sent thus
-     * far. The compression state is also reset to permit random access and
-     * recovery for clients who have discarded or damaged their own copy. This
-     * mode may degrade compression.
-     *
-     * @hide
-     * @since 1.7
-     */
-    public static final int FULL_FLUSH = 3;
-
-    /**
-     * Flush buffers and mark the end of the datastream.
-     */
-    private static final int FINISH = 4;
-
-    // Fill in the JNI id caches
-    private static native void oneTimeInitialization();
-
-    // A stub buffer used when deflate() called while inputBuffer has not been
-    // set.
-    private static final byte[] STUB_INPUT_BUFFER = new byte[0];
-
-    static {
-        oneTimeInitialization();
-    }
-
-    private int flushParm = NO_FLUSH;
-
-    private boolean finished;
-
-    private int compressLevel = DEFAULT_COMPRESSION;
-
-    private int strategy = DEFAULT_STRATEGY;
-
-    private long streamHandle = -1;
-
-    private byte[] inputBuffer;
-
-    private int inRead;
-
-    private int inLength;
-
-    /**
-     * Constructs a new {@code Deflater} instance with default compression
-     * level. The strategy can be specified with {@link #setStrategy}, only. A
-     * header is added to the output by default; use constructor {@code
-     * Deflater(level, boolean)} if you need to omit the header.
-     */
-    public Deflater() {
-        this(DEFAULT_COMPRESSION, false);
-    }
-
-    /**
-     * Constructs a new {@code Deflater} instance with a specific compression
-     * level. The strategy can be specified with {@code setStrategy}, only. A
-     * header is added to the output by default; use
-     * {@code Deflater(level, boolean)} if you need to omit the header.
-     *
-     * @param level
-     *            the compression level in the range between 0 and 9.
-     */
-    public Deflater(int level) {
-        this(level, false);
-    }
-
-    /**
-     * Constructs a new {@code Deflater} instance with a specific compression
-     * level. If noHeader is passed as true no ZLib header is added to the
-     * output. In a ZIP archive every entry (compressed file) comes with such a
-     * header. The strategy can be specified with the setStrategy method, only.
-     *
-     * @param level
-     *            the compression level in the range between 0 and 9.
-     * @param noHeader
-     *            {@code true} indicates that no ZLIB header should be written.
-     */
-    public Deflater(int level, boolean noHeader) {
-        super();
-        if (level < DEFAULT_COMPRESSION || level > BEST_COMPRESSION) {
-            throw new IllegalArgumentException();
-        }
-        compressLevel = level;
-        streamHandle = createStream(compressLevel, strategy, noHeader);
-    }
-
-    /**
-     * Deflates the data (previously passed to {@code setInput}) into the
-     * supplied buffer.
-     *
-     * @param buf
-     *            buffer to write compressed data to.
-     * @return number of bytes of compressed data written to {@code buf}.
-     * @see #deflate(byte[], int, int)
-     */
-    public int deflate(byte[] buf) {
-        return deflate(buf, 0, buf.length);
-    }
-
-    /**
-     * Deflates data (previously passed to {@code setInput}) into a specific
-     * region within the supplied buffer.
-     *
-     * @param buf
-     *            the buffer to write compressed data to.
-     * @param off
-     *            the offset within {@code buf} at which to start writing to.
-     * @param nbytes
-     *            maximum number of bytes of compressed data to be written.
-     * @return the number of bytes of compressed data written to {@code buf}.
-     */
-    public synchronized int deflate(byte[] buf, int off, int nbytes) {
-        return deflateImpl(buf, off, nbytes, flushParm);
-    }
-
-    /**
-     * Deflates data (previously passed to {@code setInput}) into a specific
-     * region within the supplied buffer, optionally flushing the input buffer.
-     *
-     * @param buf the buffer to write compressed data to.
-     * @param off the offset within {@code buf} at which to start writing to.
-     * @param nbytes maximum number of bytes of compressed data to be written.
-     * @param flush one of {@link #NO_FLUSH}, {@link #SYNC_FLUSH} or
-     *      {@link #FULL_FLUSH}.
-     * @return the number of compressed bytes written to {@code buf}. If this
-     *      equals {@code nbytes}, the number of bytes of input to be flushed
-     *      may have exceeded the output buffer's capacity. In this case,
-     *      finishing a flush will require the output buffer to be drained
-     *      and additional calls to {@link #deflate} to be made.
-     * @hide
-     * @since 1.7
-     */
-    public synchronized int deflate(byte[] buf, int off, int nbytes, int flush) {
-        if (flush != NO_FLUSH && flush != SYNC_FLUSH && flush != FULL_FLUSH) {
-            throw new IllegalArgumentException();
-        }
-        return deflateImpl(buf, off, nbytes, flush);
-    }
-
-    private synchronized int deflateImpl(
-            byte[] buf, int off, int nbytes, int flush) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        if (off > buf.length || nbytes < 0 || off < 0 || buf.length - off < nbytes) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-        if (inputBuffer == null) {
-            setInput(STUB_INPUT_BUFFER);
-        }
-        return deflateImpl(buf, off, nbytes, streamHandle, flush);
-    }
-
-    private synchronized native int deflateImpl(byte[] buf, int off,
-            int nbytes, long handle, int flushParm1);
-
-    private synchronized native void endImpl(long handle);
-
-    /**
-     * Frees all resources held onto by this deflating algorithm. Any unused
-     * input or output is discarded. While this method is used by {@code
-     * finalize()}, it can be called explicitly in order to free native
-     * resources before the next GC cycle. After {@code end()} was called other
-     * methods will typically throw an {@code IllegalStateException}.
-     */
-    public synchronized void end() {
-        endImpl();
-    }
-
-    private void endImpl() {
-        if (streamHandle != -1) {
-            endImpl(streamHandle);
-            inputBuffer = null;
-            streamHandle = -1;
-        }
-    }
-
-    @Override
-    protected void finalize() {
-        synchronized (this) {
-            end(); // to allow overriding classes to clean up
-            endImpl(); // in case those classes don't call super.end()
-        }
-    }
-
-    /**
-     * Indicates to the {@code Deflater} that all uncompressed input has been provided
-     * to it.
-     *
-     * @see #finished
-     */
-    public synchronized void finish() {
-        flushParm = FINISH;
-    }
-
-    /**
-     * Returns whether or not all provided data has been successfully
-     * compressed.
-     *
-     * @return true if all data has been compressed, false otherwise.
-     */
-    public synchronized boolean finished() {
-        return finished;
-    }
-
-    /**
-     * Returns the Adler32 checksum of uncompressed data currently read. If a
-     * preset dictionary is used getAdler() will return the Adler32 checksum of
-     * the dictionary used.
-     *
-     * @return the Adler32 checksum of uncompressed data or preset dictionary if
-     *         used.
-     * @see #setDictionary(byte[])
-     * @see #setDictionary(byte[], int, int)
-     */
-    public synchronized int getAdler() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-
-        return getAdlerImpl(streamHandle);
-    }
-
-    private synchronized native int getAdlerImpl(long handle);
-
-    /**
-     * Returns the total number of bytes of input consumed by the {@code Deflater}.
-     *
-     * @return number of bytes of input read.
-     */
-    public synchronized int getTotalIn() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-
-        return (int) getTotalInImpl(streamHandle);
-    }
-
-    private synchronized native long getTotalInImpl(long handle);
-
-    /**
-     * Returns the total number of compressed bytes output by this {@code Deflater}.
-     *
-     * @return number of compressed bytes output.
-     */
-    public synchronized int getTotalOut() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-
-        return (int) getTotalOutImpl(streamHandle);
-    }
-
-    private synchronized native long getTotalOutImpl(long handle);
-
-    /**
-     * Counterpart to setInput(). Indicates whether or not all bytes of
-     * uncompressed input have been consumed by the {@code Deflater}. If needsInput()
-     * returns true setInput() must be called before deflation can continue. If
-     * all bytes of uncompressed data have been provided to the {@code Deflater}
-     * finish() must be called to ensure the compressed data is output.
-     *
-     * @return {@code true} if input is required for deflation to continue,
-     *         {@code false} otherwise.
-     * @see #finished()
-     * @see #setInput(byte[])
-     * @see #setInput(byte[], int, int)
-     */
-    public synchronized boolean needsInput() {
-        if (inputBuffer == null) {
-            return true;
-        }
-        return inRead == inLength;
-    }
-
-    /**
-     * Resets the {@code Deflater} to accept new input without affecting any
-     * previously made settings for the compression strategy or level. This
-     * operation <i>must</i> be called after {@code finished()} returns
-     * {@code true} if the {@code Deflater} is to be reused.
-     *
-     * @see #finished
-     */
-    public synchronized void reset() {
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-
-        flushParm = NO_FLUSH;
-        finished = false;
-        resetImpl(streamHandle);
-        inputBuffer = null;
-    }
-
-    private synchronized native void resetImpl(long handle);
-
-    /**
-     * Sets the dictionary to be used for compression by this {@code Deflater}.
-     * setDictionary() can only be called if this {@code Deflater} supports the writing
-     * of ZLIB headers. This is the default behaviour but can be overridden
-     * using {@code Deflater(int, boolean)}.
-     *
-     * @param buf
-     *            the buffer containing the dictionary data bytes.
-     * @see Deflater#Deflater(int, boolean)
-     */
-    public void setDictionary(byte[] buf) {
-        setDictionary(buf, 0, buf.length);
-    }
-
-    /**
-     * Sets the dictionary to be used for compression by this {@code Deflater}.
-     * setDictionary() can only be called if this {@code Deflater} supports the writing
-     * of ZLIB headers. This is the default behaviour but can be overridden
-     * using {@code Deflater(int, boolean)}.
-     *
-     * @param buf
-     *            the buffer containing the dictionary data bytes.
-     * @param off
-     *            the offset of the data.
-     * @param nbytes
-     *            the length of the data.
-     * @see Deflater#Deflater(int, boolean)
-     */
-    public synchronized void setDictionary(byte[] buf, int off, int nbytes) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            setDictionaryImpl(buf, off, nbytes, streamHandle);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    private synchronized native void setDictionaryImpl(byte[] buf, int off,
-            int nbytes, long handle);
-
-    /**
-     * Sets the input buffer the {@code Deflater} will use to extract uncompressed bytes
-     * for later compression.
-     *
-     * @param buf
-     *            the buffer.
-     */
-    public void setInput(byte[] buf) {
-        setInput(buf, 0, buf.length);
-    }
-
-    /**
-     * Sets the input buffer the {@code Deflater} will use to extract uncompressed bytes
-     * for later compression. Input will be taken from the buffer region
-     * starting at off and ending at nbytes - 1.
-     *
-     * @param buf
-     *            the buffer containing the input data bytes.
-     * @param off
-     *            the offset of the data.
-     * @param nbytes
-     *            the length of the data.
-     */
-    public synchronized void setInput(byte[] buf, int off, int nbytes) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            inLength = nbytes;
-            inRead = 0;
-            if (inputBuffer == null) {
-                setLevelsImpl(compressLevel, strategy, streamHandle);
-            }
-            inputBuffer = buf;
-            setInputImpl(buf, off, nbytes, streamHandle);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    private synchronized native void setLevelsImpl(int level, int strategy,
-            long handle);
-
-    private synchronized native void setInputImpl(byte[] buf, int off,
-            int nbytes, long handle);
-
-    /**
-     * Sets the compression level to be used when compressing data. The
-     * compression level must be a value between 0 and 9. This value must be set
-     * prior to calling setInput().
-     *
-     * @param level
-     *            compression level to use
-     * @exception IllegalArgumentException
-     *                If the compression level is invalid.
-     */
-    public synchronized void setLevel(int level) {
-        if (level < DEFAULT_COMPRESSION || level > BEST_COMPRESSION) {
-            throw new IllegalArgumentException();
-        }
-        if (inputBuffer != null) {
-            throw new IllegalStateException();
-        }
-        compressLevel = level;
-    }
-
-    /**
-     * Sets the compression strategy to be used. The strategy must be one of
-     * FILTERED, HUFFMAN_ONLY or DEFAULT_STRATEGY.This value must be set prior
-     * to calling setInput().
-     *
-     * @param strategy
-     *            compression strategy to use
-     * @exception IllegalArgumentException
-     *                If the strategy specified is not one of FILTERED,
-     *                HUFFMAN_ONLY or DEFAULT_STRATEGY.
-     */
-    public synchronized void setStrategy(int strategy) {
-        if (strategy < DEFAULT_STRATEGY || strategy > HUFFMAN_ONLY) {
-            throw new IllegalArgumentException();
-        }
-        if (inputBuffer != null) {
-            throw new IllegalStateException();
-        }
-        this.strategy = strategy;
-    }
-
-    /**
-     * Returns a long int of total number of bytes read by the {@code Deflater}. This
-     * method performs the same as {@code getTotalIn} except it returns a long value
-     * instead of an integer
-     *
-     * @see #getTotalIn()
-     * @return total number of bytes read by {@code Deflater}.
-     */
-    public synchronized long getBytesRead() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalInImpl(streamHandle);
-    }
-
-    /**
-     * Returns a long int of total number of bytes of read by the {@code Deflater}. This
-     * method performs the same as {@code getTotalOut} except it returns a long
-     * value instead of an integer
-     *
-     * @see #getTotalOut()
-     * @return bytes exactly write by {@code Deflater}
-     */
-    public synchronized long getBytesWritten() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalOutImpl(streamHandle);
-    }
-
-    private native long createStream(int level, int strategy1, boolean noHeader1);
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/DeflaterOutputStream.java b/libcore/archive/src/main/java/java/util/zip/DeflaterOutputStream.java
deleted file mode 100644
index 7ea27fa..0000000
--- a/libcore/archive/src/main/java/java/util/zip/DeflaterOutputStream.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-
-/**
- * This class provides an implementation of {@code FilterOutputStream} that
- * compresses data using the <i>DEFLATE</i> algorithm. Basically it wraps the
- * {@code Deflater} class and takes care of the buffering.
- *
- * @see Deflater
- */
-public class DeflaterOutputStream extends FilterOutputStream {
-    static final int BUF_SIZE = 512;
-
-    /**
-     * The buffer for the data to be written to.
-     */
-    protected byte[] buf;
-
-    /**
-     * The deflater used.
-     */
-    protected Deflater def;
-
-    boolean done = false;
-
-    private final boolean syncFlush;
-
-    /**
-     * This constructor lets you pass the {@code Deflater} specifying the
-     * compression algorithm.
-     *
-     * @param os
-     *            is the {@code OutputStream} where to write the compressed data
-     *            to.
-     * @param def
-     *            is the specific {@code Deflater} that is used to compress
-     *            data.
-     */
-    public DeflaterOutputStream(OutputStream os, Deflater def) {
-        this(os, def, BUF_SIZE, false);
-    }
-
-    /**
-     * This is the most basic constructor. You only need to pass the {@code
-     * OutputStream} to which the compressed data shall be written to. The
-     * default settings for the {@code Deflater} and internal buffer are used.
-     * In particular the {@code Deflater} produces a ZLIB header in the output
-     * stream.
-     *
-     * @param os
-     *            is the OutputStream where to write the compressed data to.
-     */
-    public DeflaterOutputStream(OutputStream os) {
-        this(os, new Deflater(), BUF_SIZE, false);
-    }
-
-    /**
-     * This constructor lets you specify both the compression algorithm as well
-     * as the internal buffer size to be used.
-     *
-     * @param os
-     *            is the {@code OutputStream} where to write the compressed data
-     *            to.
-     * @param def
-     *            is the specific {@code Deflater} that will be used to compress
-     *            data.
-     * @param bsize
-     *            is the size to be used for the internal buffer.
-     */
-    public DeflaterOutputStream(OutputStream os, Deflater def, int bsize) {
-        this(os, def, bsize, false);
-    }
-
-    /**
-     * @hide
-     * @since 1.7
-     */
-    public DeflaterOutputStream(OutputStream os, boolean syncFlush) {
-        this(os, new Deflater(), BUF_SIZE, syncFlush);
-    }
-
-    /**
-     * @hide
-     * @since 1.7
-     */
-    public DeflaterOutputStream(OutputStream os, Deflater def, boolean syncFlush) {
-        this(os, def, BUF_SIZE, syncFlush);
-    }
-
-    /**
-     * @hide
-     * @since 1.7
-     */
-    public DeflaterOutputStream(OutputStream os, Deflater def, int bsize, boolean syncFlush) {
-        super(os);
-        if (os == null || def == null) {
-            throw new NullPointerException();
-        }
-        if (bsize <= 0) {
-            throw new IllegalArgumentException();
-        }
-        this.def = def;
-        this.syncFlush = syncFlush;
-        buf = new byte[bsize];
-    }
-
-    /**
-     * Compress the data in the input buffer and write it to the underlying
-     * stream.
-     *
-     * @throws IOException
-     *             If an error occurs during deflation.
-     */
-    protected void deflate() throws IOException {
-        int x = 0;
-        do {
-            x = def.deflate(buf);
-            out.write(buf, 0, x);
-        } while (!def.needsInput());
-    }
-
-    /**
-     * Writes any unwritten compressed data to the underlying stream, the closes
-     * all underlying streams. This stream can no longer be used after close()
-     * has been called.
-     *
-     * @throws IOException
-     *             If an error occurs while closing the data compression
-     *             process.
-     */
-    @Override
-    public void close() throws IOException {
-        if (!def.finished()) {
-            finish();
-        }
-        def.end();
-        out.close();
-    }
-
-    /**
-     * Writes any unwritten data to the underlying stream. Does not close the
-     * stream.
-     *
-     * @throws IOException
-     *             If an error occurs.
-     */
-    public void finish() throws IOException {
-        if (done) {
-            return;
-        }
-        def.finish();
-        int x = 0;
-        while (!def.finished()) {
-            if (def.needsInput()) {
-                def.setInput(buf, 0, 0);
-            }
-            x = def.deflate(buf);
-            out.write(buf, 0, x);
-        }
-        done = true;
-    }
-
-    @Override
-    public void write(int i) throws IOException {
-        byte[] b = new byte[1];
-        b[0] = (byte) i;
-        write(b, 0, 1);
-    }
-
-    /**
-     * Compresses {@code nbytes} of data from {@code buf} starting at
-     * {@code off} and writes it to the underlying stream.
-     *
-     * @param buffer
-     *            the buffer of data to compress.
-     * @param off
-     *            offset in buffer to extract data from.
-     * @param nbytes
-     *            the number of bytes of data to read from the buffer.
-     * @throws IOException
-     *             If an error occurs during writing.
-     */
-    @Override
-    public void write(byte[] buffer, int off, int nbytes) throws IOException {
-        if (done) {
-            throw new IOException(Messages.getString("archive.26")); //$NON-NLS-1$
-        }
-        // avoid int overflow, check null buf
-        if (off <= buffer.length && nbytes >= 0 && off >= 0
-                && buffer.length - off >= nbytes) {
-            if (!def.needsInput()) {
-                throw new IOException();
-            }
-            def.setInput(buffer, off, nbytes);
-            deflate();
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    /**
-     * Flushes the underlying stream. This flushes only the bytes that can be
-     * compressed at the highest level.
-     *
-     * <p>For deflater output streams constructed with Java 7's
-     * {@code syncFlush} parameter set to true (not yet available on Android),
-     * this first flushes all outstanding data so that it may be immediately
-     * read by its recipient. Doing so may degrade compression.
-     */
-    @Override public void flush() throws IOException {
-        if (syncFlush) {
-            int count = def.deflate(buf, 0, buf.length, Deflater.SYNC_FLUSH);
-            out.write(buf, 0, count);
-        }
-        out.flush();
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/GZIPInputStream.java b/libcore/archive/src/main/java/java/util/zip/GZIPInputStream.java
deleted file mode 100644
index dd0da9b..0000000
--- a/libcore/archive/src/main/java/java/util/zip/GZIPInputStream.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-
-/**
- * The {@code GZIPInputStream} class is used to read data stored in the GZIP
- * format, reading and decompressing GZIP data from the underlying stream into
- * its buffer.
- */
-public class GZIPInputStream extends InflaterInputStream {
-
-    private static final int FCOMMENT = 16;
-
-    private static final int FEXTRA = 4;
-
-    private static final int FHCRC = 2;
-
-    private static final int FNAME = 8;
-
-    /**
-     * The magic header for the GZIP format.
-     */
-    public final static int GZIP_MAGIC = 0x8b1f;
-
-    /**
-     * The checksum algorithm used when handling uncompressed data.
-     */
-    protected CRC32 crc = new CRC32();
-
-    /**
-     * Indicates the end of the input stream.
-     */
-    protected boolean eos = false;
-
-    /**
-     * Construct a {@code GZIPInputStream} to read from GZIP data from the
-     * underlying stream.
-     *
-     * @param is
-     *            the {@code InputStream} to read data from.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public GZIPInputStream(InputStream is) throws IOException {
-        this(is, BUF_SIZE);
-    }
-
-    /**
-     * Construct a {@code GZIPInputStream} to read from GZIP data from the
-     * underlying stream. Set the internal buffer size to {@code size}.
-     *
-     * @param is
-     *            the {@code InputStream} to read data from.
-     * @param size
-     *            the internal read buffer size.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public GZIPInputStream(InputStream is, int size) throws IOException {
-        super(is, new Inflater(true), size);
-        byte[] header = new byte[10];
-        readFully(header, 0, header.length);
-        if (getShort(header, 0) != GZIP_MAGIC) {
-            throw new IOException(Messages.getString("archive.1F")); //$NON-NLS-1$;
-        }
-        int flags = header[3];
-        boolean hcrc = (flags & FHCRC) != 0;
-        if (hcrc) {
-            crc.update(header, 0, header.length);
-        }
-        if ((flags & FEXTRA) != 0) {
-            readFully(header, 0, 2);
-            if (hcrc) {
-                crc.update(header, 0, 2);
-            }
-            int length = getShort(header, 0);
-            while (length > 0) {
-                int max = length > buf.length ? buf.length : length;
-                int result = in.read(buf, 0, max);
-                if (result == -1) {
-                    throw new EOFException();
-                }
-                if (hcrc) {
-                    crc.update(buf, 0, result);
-                }
-                length -= result;
-            }
-        }
-        if ((flags & FNAME) != 0) {
-            readZeroTerminated(hcrc);
-        }
-        if ((flags & FCOMMENT) != 0) {
-            readZeroTerminated(hcrc);
-        }
-        if (hcrc) {
-            readFully(header, 0, 2);
-            int crc16 = getShort(header, 0);
-            if ((crc.getValue() & 0xffff) != crc16) {
-                throw new IOException(Messages.getString("archive.20")); //$NON-NLS-1$
-            }
-            crc.reset();
-        }
-    }
-
-    /**
-     * Closes this stream and any underlying streams.
-     */
-    @Override
-    public void close() throws IOException {
-        eos = true;
-        super.close();
-    }
-
-    private long getLong(byte[] buffer, int off) {
-        long l = 0;
-        l |= (buffer[off] & 0xFF);
-        l |= (buffer[off + 1] & 0xFF) << 8;
-        l |= (buffer[off + 2] & 0xFF) << 16;
-        l |= ((long) (buffer[off + 3] & 0xFF)) << 24;
-        return l;
-    }
-
-    private int getShort(byte[] buffer, int off) {
-        return (buffer[off] & 0xFF) | ((buffer[off + 1] & 0xFF) << 8);
-    }
-
-    /**
-     * Reads and decompresses GZIP data from the underlying stream into the
-     * given buffer.
-     *
-     * @param buffer
-     *            Buffer to receive data
-     * @param off
-     *            Offset in buffer to store data
-     * @param nbytes
-     *            Number of bytes to read
-     */
-    @Override
-    public int read(byte[] buffer, int off, int nbytes) throws IOException {
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (eos) {
-            return -1;
-        }
-        // avoid int overflow, check null buffer
-        if (off > buffer.length || nbytes < 0 || off < 0
-                || buffer.length - off < nbytes) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-
-        int bytesRead;
-        try {
-            bytesRead = super.read(buffer, off, nbytes);
-        } finally {
-            eos = eof; // update eos after every read(), even when it throws
-        }
-
-        if (bytesRead != -1) {
-            crc.update(buffer, off, bytesRead);
-        }
-
-        if (eos) {
-            verifyCrc();
-        }
-
-        return bytesRead;
-    }
-
-    private void verifyCrc() throws IOException {
-        // Get non-compressed bytes read by fill
-        int size = inf.getRemaining();
-        final int trailerSize = 8; // crc (4 bytes) + total out (4 bytes)
-        byte[] b = new byte[trailerSize];
-        int copySize = (size > trailerSize) ? trailerSize : size;
-
-        System.arraycopy(buf, len - size, b, 0, copySize);
-        readFully(b, copySize, trailerSize - copySize);
-
-        if (getLong(b, 0) != crc.getValue()) {
-            throw new IOException(Messages.getString("archive.20")); //$NON-NLS-1$
-        }
-        if ((int) getLong(b, 4) != inf.getTotalOut()) {
-            throw new IOException(Messages.getString("archive.21")); //$NON-NLS-1$
-        }
-    }
-
-    private void readFully(byte[] buffer, int offset, int length)
-            throws IOException {
-        int result;
-        while (length > 0) {
-            result = in.read(buffer, offset, length);
-            if (result == -1) {
-                throw new EOFException();
-            }
-            offset += result;
-            length -= result;
-        }
-    }
-
-    private void readZeroTerminated(boolean hcrc) throws IOException {
-        int result;
-        while ((result = in.read()) > 0) {
-            if (hcrc) {
-                crc.update(result);
-            }
-        }
-        if (result == -1) {
-            throw new EOFException();
-        }
-        // Add the zero
-        if (hcrc) {
-            crc.update(result);
-        }
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/GZIPOutputStream.java b/libcore/archive/src/main/java/java/util/zip/GZIPOutputStream.java
deleted file mode 100644
index 02510db..0000000
--- a/libcore/archive/src/main/java/java/util/zip/GZIPOutputStream.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * The {@code GZIPOutputStream} class is used to write data to a stream in the
- * GZIP storage format.
- */
-public class GZIPOutputStream extends DeflaterOutputStream {
-
-    /**
-     * The checksum algorithm used when treating uncompressed data.
-     */
-    protected CRC32 crc = new CRC32();
-
-    /**
-     * Construct a new {@code GZIPOutputStream} to write data in GZIP format to
-     * the underlying stream.
-     *
-     * @param os
-     *            the {@code OutputStream} to write data to.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public GZIPOutputStream(OutputStream os) throws IOException {
-        this(os, BUF_SIZE);
-    }
-
-    /**
-     * Construct a new {@code GZIPOutputStream} to write data in GZIP format to
-     * the underlying stream. Set the internal compression buffer to size
-     * {@code size}.
-     *
-     * @param os
-     *            the {@code OutputStream} to write to.
-     * @param size
-     *            the internal buffer size.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public GZIPOutputStream(OutputStream os, int size) throws IOException {
-        super(os, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size);
-        writeShort(GZIPInputStream.GZIP_MAGIC);
-        out.write(Deflater.DEFLATED);
-        out.write(0); // flags
-        writeLong(0); // mod time
-        out.write(0); // extra flags
-        out.write(0); // operating system
-    }
-
-    /**
-     * Indicates to the stream that all data has been written out, and any GZIP
-     * terminal data can now be written.
-     *
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    @Override
-    public void finish() throws IOException {
-        super.finish();
-        writeLong(crc.getValue());
-        writeLong(crc.tbytes);
-    }
-
-    /**
-     * Write up to nbytes of data from the given buffer, starting at offset off,
-     * to the underlying stream in GZIP format.
-     */
-    @Override
-    public void write(byte[] buffer, int off, int nbytes) throws IOException {
-        super.write(buffer, off, nbytes);
-        crc.update(buffer, off, nbytes);
-    }
-
-    private long writeLong(long i) throws IOException {
-        // Write out the long value as an unsigned int
-        int unsigned = (int) i;
-        out.write(unsigned & 0xFF);
-        out.write((unsigned >> 8) & 0xFF);
-        out.write((unsigned >> 16) & 0xFF);
-        out.write((unsigned >> 24) & 0xFF);
-        return i;
-    }
-
-    private int writeShort(int i) throws IOException {
-        out.write(i & 0xFF);
-        out.write((i >> 8) & 0xFF);
-        return i;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/Inflater.java b/libcore/archive/src/main/java/java/util/zip/Inflater.java
deleted file mode 100644
index 4921d3d..0000000
--- a/libcore/archive/src/main/java/java/util/zip/Inflater.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-
-import java.io.FileDescriptor; // android-only
-
-/**
- * This class uncompresses data that was compressed using the <i>DEFLATE</i>
- * algorithm (see <a href="http://www.gzip.org/algorithm.txt">specification</a>).
- * <p>
- * Basically this class is part of the API to the stream based ZLIB compression
- * library and is used as such by {@code InflaterInputStream} and its
- * descendants.
- * <p>
- * The typical usage of a {@code Inflater} outside this package consists of a
- * specific call to one of its constructors before being passed to an instance
- * of {@code InflaterInputStream}.
- *
- * @see InflaterInputStream
- * @see Deflater
- */
-public class Inflater {
-
-    static {
-        oneTimeInitialization();
-    }
-
-    // Fill in the JNI id caches
-    private static native void oneTimeInitialization();
-
-    private boolean finished; // Set by the inflateImpl native
-
-    int inLength;
-
-    int inRead;
-
-    private boolean needsDictionary; // Set by the inflateImpl native
-
-    private long streamHandle = -1;
-
-    /**
-     * This constructor creates an inflater that expects a header from the input
-     * stream. Use {@code Inflater(boolean)} if the input comes without a ZLIB
-     * header.
-     */
-    public Inflater() {
-        this(false);
-    }
-
-    /**
-     * This constructor allows to create an inflater that expects no header from
-     * the input stream.
-     *
-     * @param noHeader
-     *            {@code true} indicates that no ZLIB header comes with the
-     *            input.
-     */
-    public Inflater(boolean noHeader) {
-        streamHandle = createStream(noHeader);
-    }
-
-    private native long createStream(boolean noHeader1);
-
-    /**
-     * Release any resources associated with this {@code Inflater}. Any unused
-     * input/output is discarded. This is also called by the finalize method.
-     */
-    public synchronized void end() {
-        if (streamHandle != -1) {
-            endImpl(streamHandle);
-            inRead = 0;
-            inLength = 0;
-            streamHandle = -1;
-        }
-    }
-
-    private native synchronized void endImpl(long handle);
-
-    @Override
-    protected void finalize() {
-        end();
-    }
-
-    /**
-     * Indicates if the {@code Inflater} has inflated the entire deflated
-     * stream. If deflated bytes remain and {@code needsInput()} returns {@code
-     * true} this method will return {@code false}. This method should be
-     * called after all deflated input is supplied to the {@code Inflater}.
-     *
-     * @return {@code true} if all input has been inflated, {@code false}
-     *         otherwise.
-     */
-    public synchronized boolean finished() {
-        return finished;
-    }
-
-    /**
-     * Returns the <i>Adler32</i> checksum of either all bytes inflated, or the
-     * checksum of the preset dictionary if one has been supplied.
-     *
-     * @return The <i>Adler32</i> checksum associated with this
-     *         {@code Inflater}.
-     */
-    public synchronized int getAdler() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        return getAdlerImpl(streamHandle);
-    }
-
-    private native synchronized int getAdlerImpl(long handle);
-
-    /**
-     * Returns the total number of bytes read by the {@code Inflater}. This
-     * method performs the same as {@code getTotalIn()} except that it returns a
-     * {@code long} value instead of an integer.
-     *
-     * @return the total number of bytes read.
-     */
-    public synchronized long getBytesRead() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalInImpl(streamHandle);
-    }
-
-    /**
-     * Returns a the total number of bytes read by the {@code Inflater}. This
-     * method performs the same as {@code getTotalOut} except it returns a
-     * {@code long} value instead of an integer.
-     *
-     * @return the total bytes written to the output buffer.
-     */
-    public synchronized long getBytesWritten() {
-        // Throw NPE here
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        return getTotalOutImpl(streamHandle);
-    }
-
-    /**
-     * Returns the number of bytes of current input remaining to be read by the
-     * inflater.
-     *
-     * @return the number of bytes of unread input.
-     */
-    public synchronized int getRemaining() {
-        return inLength - inRead;
-    }
-
-    /**
-     * Returns total number of bytes of input read by the {@code Inflater}. The
-     * result value is limited by {@code Integer.MAX_VALUE}.
-     *
-     * @return the total number of bytes read.
-     */
-    public synchronized int getTotalIn() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        long totalIn = getTotalInImpl(streamHandle);
-        return (totalIn <= Integer.MAX_VALUE ? (int) totalIn
-                : Integer.MAX_VALUE);
-    }
-
-    private synchronized native long getTotalInImpl(long handle);
-
-    /**
-     * Returns total number of bytes written to the output buffer by the {@code
-     * Inflater}. The result value is limited by {@code Integer.MAX_VALUE}.
-     *
-     * @return the total bytes of output data written.
-     */
-    public synchronized int getTotalOut() {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        long totalOut = getTotalOutImpl(streamHandle);
-        return (totalOut <= Integer.MAX_VALUE ? (int) totalOut
-                : Integer.MAX_VALUE);
-    }
-
-    private native synchronized long getTotalOutImpl(long handle);
-
-    /**
-     * Inflates bytes from current input and stores them in {@code buf}.
-     *
-     * @param buf
-     *            the buffer where decompressed data bytes are written.
-     * @return the number of bytes inflated.
-     * @throws DataFormatException
-     *             if the underlying stream is corrupted or was not compressed
-     *             using a {@code Deflater}.
-     */
-    public int inflate(byte[] buf) throws DataFormatException {
-        return inflate(buf, 0, buf.length);
-    }
-
-    /**
-     * Inflates up to n bytes from the current input and stores them in {@code
-     * buf} starting at {@code off}.
-     *
-     * @param buf
-     *            the buffer to write inflated bytes to.
-     * @param off
-     *            the offset in buffer where to start writing decompressed data.
-     * @param nbytes
-     *            the number of inflated bytes to write to {@code buf}.
-     * @throws DataFormatException
-     *             if the underlying stream is corrupted or was not compressed
-     *             using a {@code Deflater}.
-     * @return the number of bytes inflated.
-     */
-    public synchronized int inflate(byte[] buf, int off, int nbytes)
-            throws DataFormatException {
-        // avoid int overflow, check null buf
-        if (off > buf.length || nbytes < 0 || off < 0
-                || buf.length - off < nbytes) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-
-        if (nbytes == 0) {
-            return 0;
-        }
-
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-
-        if (needsInput()) {
-            return 0;
-        }
-
-        boolean neededDict = needsDictionary;
-        needsDictionary = false;
-        int result = inflateImpl(buf, off, nbytes, streamHandle);
-        if (needsDictionary && neededDict) {
-            throw new DataFormatException(
-                    Messages.getString("archive.27")); //$NON-NLS-1$
-        }
-
-        return result;
-    }
-
-    private native synchronized int inflateImpl(byte[] buf, int off,
-            int nbytes, long handle);
-
-    /**
-     * Indicates whether the input bytes were compressed with a preset
-     * dictionary. This method should be called prior to {@code inflate()} to
-     * determine whether a dictionary is required. If so {@code setDictionary()}
-     * should be called with the appropriate dictionary prior to calling {@code
-     * inflate()}.
-     *
-     * @return {@code true} if a preset dictionary is required for inflation.
-     * @see #setDictionary(byte[])
-     * @see #setDictionary(byte[], int, int)
-     */
-    public synchronized boolean needsDictionary() {
-        return needsDictionary;
-    }
-
-    /**
-     * Indicates that input has to be passed to the inflater.
-     *
-     * @return {@code true} if {@code setInput} has to be called before
-     *         inflation can proceed.
-     * @see #setInput(byte[])
-     */
-    public synchronized boolean needsInput() {
-        return inRead == inLength;
-    }
-
-    /**
-     * Resets the {@code Inflater}. Should be called prior to inflating a new
-     * set of data.
-     */
-    public synchronized void reset() {
-        if (streamHandle == -1) {
-            throw new NullPointerException();
-        }
-        finished = false;
-        needsDictionary = false;
-        inLength = inRead = 0;
-        resetImpl(streamHandle);
-    }
-
-    private native synchronized void resetImpl(long handle);
-
-    /**
-     * Sets the preset dictionary to be used for inflation to {@code buf}.
-     * {@code needsDictionary()} can be called to determine whether the current
-     * input was deflated using a preset dictionary.
-     *
-     * @param buf
-     *            The buffer containing the dictionary bytes.
-     * @see #needsDictionary
-     */
-    public synchronized void setDictionary(byte[] buf) {
-        setDictionary(buf, 0, buf.length);
-    }
-
-    /**
-     * Like {@code setDictionary(byte[])}, allowing to define a specific region
-     * inside {@code buf} to be used as a dictionary.
-     * <p>
-     * The dictionary should be set if the {@link #inflate(byte[])} returned
-     * zero bytes inflated and {@link #needsDictionary()} returns
-     * <code>true</code>.
-     *
-     * @param buf
-     *            the buffer containing the dictionary data bytes.
-     * @param off
-     *            the offset of the data.
-     * @param nbytes
-     *            the length of the data.
-     * @see #needsDictionary
-     */
-    public synchronized void setDictionary(byte[] buf, int off, int nbytes) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            setDictionaryImpl(buf, off, nbytes, streamHandle);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    private native synchronized void setDictionaryImpl(byte[] buf, int off,
-            int nbytes, long handle);
-
-    /**
-     * Sets the current input to to be decrompressed. This method should only be
-     * called if {@code needsInput()} returns {@code true}.
-     *
-     * @param buf
-     *            the input buffer.
-     * @see #needsInput
-     */
-    public synchronized void setInput(byte[] buf) {
-        setInput(buf, 0, buf.length);
-    }
-
-    /**
-     * Sets the current input to the region of the input buffer starting at
-     * {@code off} and ending at {@code nbytes - 1} where data is written after
-     * decompression. This method should only be called if {@code needsInput()}
-     * returns {@code true}.
-     *
-     * @param buf
-     *            the input buffer.
-     * @param off
-     *            the offset to read from the input buffer.
-     * @param nbytes
-     *            the number of bytes to read.
-     * @see #needsInput
-     */
-    public synchronized void setInput(byte[] buf, int off, int nbytes) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        // avoid int overflow, check null buf
-        if (off <= buf.length && nbytes >= 0 && off >= 0
-                && buf.length - off >= nbytes) {
-            inRead = 0;
-            inLength = nbytes;
-            setInputImpl(buf, off, nbytes, streamHandle);
-        } else {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-    }
-
-    // BEGIN android-only
-    /**
-     * Sets the current input to the region within a file starting at {@code
-     * off} and ending at {@code nbytes - 1}. This method should only be called
-     * if {@code needsInput()} returns {@code true}.
-     *
-     * @param fd
-     *            the input file.
-     * @param off
-     *            the offset to read from in buffer.
-     * @param nbytes
-     *            the number of bytes to read.
-     * @see #needsInput
-     */
-    synchronized int setFileInput(FileDescriptor fd, long off, int nbytes) {
-        if (streamHandle == -1) {
-            throw new IllegalStateException();
-        }
-        inRead = 0;
-        inLength = setFileInputImpl(fd, off, nbytes, streamHandle);
-        return inLength;
-    }
-    // END android-only
-
-    private native synchronized void setInputImpl(byte[] buf, int off,
-            int nbytes, long handle);
-
-    // BEGIN android-only
-    private native synchronized int setFileInputImpl(FileDescriptor fd, long off,
-            int nbytes, long handle);
-    // END android-only
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/InflaterInputStream.java b/libcore/archive/src/main/java/java/util/zip/InflaterInputStream.java
deleted file mode 100644
index 8cd8cf2..0000000
--- a/libcore/archive/src/main/java/java/util/zip/InflaterInputStream.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.EOFException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-
-/**
- * This class provides an implementation of {@code FilterInputStream} that
- * uncompresses data that was compressed using the <i>DEFLATE</i> algorithm
- * (see <a href="http://www.gzip.org/algorithm.txt">specification</a>).
- * Basically it wraps the {@code Inflater} class and takes care of the
- * buffering.
- *
- * @see Inflater
- * @see DeflaterOutputStream
- */
-public class InflaterInputStream extends FilterInputStream {
-
-    /**
-     * The inflater used for this stream.
-     */
-    protected Inflater inf;
-
-    /**
-     * The input buffer used for decompression.
-     */
-    protected byte[] buf;
-
-    /**
-     * The length of the buffer.
-     */
-    protected int len;
-
-    boolean closed;
-
-    /**
-     * True if this stream's last byte has been returned to the user. This
-     * could be because the underlying stream has been exhausted, or if errors
-     * were encountered while inflating that stream.
-     */
-    boolean eof;
-
-    static final int BUF_SIZE = 512;
-
-    int nativeEndBufSize = 0; // android-only
-
-    /**
-     * This is the most basic constructor. You only need to pass the {@code
-     * InputStream} from which the compressed data is to be read from. Default
-     * settings for the {@code Inflater} and internal buffer are be used. In
-     * particular the Inflater expects a ZLIB header from the input stream.
-     *
-     * @param is
-     *            the {@code InputStream} to read data from.
-     */
-    public InflaterInputStream(InputStream is) {
-        this(is, new Inflater(), BUF_SIZE);
-    }
-
-    /**
-     * This constructor lets you pass a specifically initialized Inflater,
-     * for example one that expects no ZLIB header.
-     *
-     * @param is
-     *            the {@code InputStream} to read data from.
-     * @param inf
-     *            the specific {@code Inflater} for uncompressing data.
-     */
-    public InflaterInputStream(InputStream is, Inflater inf) {
-        this(is, inf, BUF_SIZE);
-    }
-
-    /**
-     * This constructor lets you specify both the {@code Inflater} as well as
-     * the internal buffer size to be used.
-     *
-     * @param is
-     *            the {@code InputStream} to read data from.
-     * @param inf
-     *            the specific {@code Inflater} for uncompressing data.
-     * @param bsize
-     *            the size to be used for the internal buffer.
-     */
-    public InflaterInputStream(InputStream is, Inflater inf, int bsize) {
-        super(is);
-        if (is == null || inf == null) {
-            throw new NullPointerException();
-        }
-        if (bsize <= 0) {
-            throw new IllegalArgumentException();
-        }
-        this.inf = inf;
-        // BEGIN android-only
-        if (is instanceof ZipFile.RAFStream) {
-            nativeEndBufSize = bsize;
-        } else {
-            buf = new byte[bsize];
-        }
-        // END android-only
-    }
-
-    /**
-     * Reads a single byte of decompressed data.
-     *
-     * @return the byte read.
-     * @throws IOException
-     *             if an error occurs reading the byte.
-     */
-    @Override
-    public int read() throws IOException {
-        byte[] b = new byte[1];
-        if (read(b, 0, 1) == -1) {
-            return -1;
-        }
-        return b[0] & 0xff;
-    }
-
-    /**
-     * Reads up to {@code nbytes} of decompressed data and stores it in
-     * {@code buffer} starting at {@code off}.
-     *
-     * @param buffer
-     *            the buffer to write data to.
-     * @param off
-     *            offset in buffer to start writing.
-     * @param nbytes
-     *            number of bytes to read.
-     * @return Number of uncompressed bytes read
-     * @throws IOException
-     *             if an IOException occurs.
-     */
-    @Override
-    public int read(byte[] buffer, int off, int nbytes) throws IOException {
-        /* archive.1E=Stream is closed */
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-
-        if (null == buffer) {
-            throw new NullPointerException();
-        }
-
-        if (off < 0 || nbytes < 0 || off + nbytes > buffer.length) {
-            throw new IndexOutOfBoundsException();
-        }
-
-        if (nbytes == 0) {
-            return 0;
-        }
-
-        if (eof) {
-            return -1;
-        }
-
-        // avoid int overflow, check null buffer
-        if (off > buffer.length || nbytes < 0 || off < 0
-                || buffer.length - off < nbytes) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-
-        do {
-            if (inf.needsInput()) {
-                fill();
-            }
-            // Invariant: if reading returns -1 or throws, eof must be true.
-            // It may also be true if the next read() should return -1.
-            try {
-                int result = inf.inflate(buffer, off, nbytes);
-                eof = inf.finished();
-                if (result > 0) {
-                    return result;
-                } else if (eof) {
-                    return -1;
-                } else if (inf.needsDictionary()) {
-                    eof = true;
-                    return -1;
-                } else if (len == -1) {
-                    eof = true;
-                    throw new EOFException();
-                    // If result == 0, fill() and try again
-                }
-            } catch (DataFormatException e) {
-                eof = true;
-                if (len == -1) {
-                    throw new EOFException();
-                }
-                throw (IOException) (new IOException().initCause(e));
-            }
-        } while (true);
-    }
-
-    /**
-     * Fills the input buffer with data to be decompressed.
-     *
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    protected void fill() throws IOException {
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        // BEGIN android-only
-        if (nativeEndBufSize > 0) {
-            ZipFile.RAFStream is = (ZipFile.RAFStream)in;
-            synchronized (is.mSharedRaf) {
-                long len = is.mLength - is.mOffset;
-                if (len > nativeEndBufSize) len = nativeEndBufSize;
-                int cnt = inf.setFileInput(is.mSharedRaf.getFD(), is.mOffset, (int)nativeEndBufSize);
-                is.skip(cnt);
-            }
-        } else {
-            if ((len = in.read(buf)) > 0) {
-                inf.setInput(buf, 0, len);
-            }
-        }
-        // END android-only
-    }
-
-    /**
-     * Skips up to n bytes of uncompressed data.
-     *
-     * @param nbytes
-     *            the number of bytes to skip.
-     * @return the number of uncompressed bytes skipped.
-     * @throws IOException
-     *             if an error occurs skipping.
-     */
-    @Override
-    public long skip(long nbytes) throws IOException {
-        if (nbytes >= 0) {
-            if (buf == null) {
-                buf = new byte[(int)Math.min(nbytes, BUF_SIZE)];
-            }
-            long count = 0, rem = 0;
-            while (count < nbytes) {
-                int x = read(buf, 0,
-                        (rem = nbytes - count) > buf.length ? buf.length
-                                : (int) rem);
-                if (x == -1) {
-                    return count;
-                }
-                count += x;
-            }
-            return count;
-        }
-        throw new IllegalArgumentException();
-    }
-
-    /**
-     * Returns 0 when when this stream has exhausted its input; and 1 otherwise.
-     * A result of 1 does not guarantee that further bytes can be returned,
-     * with or without blocking.
-     *
-     * <p>Although consistent with the RI, this behavior is inconsistent with
-     * {@link InputStream#available()}, and violates the <a
-     * href="http://en.wikipedia.org/wiki/Liskov_substitution_principle">Liskov
-     * Substitution Principle</a>. This method should not be used.
-     *
-     * @return 0 if no further bytes are available. Otherwise returns 1,
-     *         which suggests (but does not guarantee) that additional bytes are
-     *         available.
-     * @throws IOException if this stream is closed or an error occurs
-     */
-    @Override
-    public int available() throws IOException {
-        if (closed) {
-            // archive.1E=Stream is closed
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (eof) {
-            return 0;
-        }
-        return 1;
-    }
-
-    /**
-     * Closes the input stream.
-     *
-     * @throws IOException
-     *             If an error occurs closing the input stream.
-     */
-    @Override
-    public void close() throws IOException {
-        if (!closed) {
-            inf.end();
-            closed = true;
-            eof = true;
-            super.close();
-        }
-    }
-
-    /**
-     * Marks the current position in the stream. This implementation overrides
-     * the super type implementation to do nothing at all.
-     *
-     * @param readlimit
-     *            of no use.
-     */
-    @Override
-    public void mark(int readlimit) {
-        // do nothing
-    }
-
-    /**
-     * Reset the position of the stream to the last marked position. This
-     * implementation overrides the supertype implementation and always throws
-     * an {@link IOException IOException} when called.
-     *
-     * @throws IOException
-     *             if the method is called
-     */
-    @Override
-    public void reset() throws IOException {
-        throw new IOException();
-    }
-
-    /**
-     * Returns whether the receiver implements {@code mark} semantics. This type
-     * does not support {@code mark()}, so always responds {@code false}.
-     *
-     * @return false, always
-     */
-    @Override
-    public boolean markSupported() {
-        return false;
-    }
-
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipConstants.java b/libcore/archive/src/main/java/java/util/zip/ZipConstants.java
deleted file mode 100644
index 9fbce06..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipConstants.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-interface ZipConstants {
-
-    public static final long LOCSIG = 0x4034b50, EXTSIG = 0x8074b50,
-            CENSIG = 0x2014b50, ENDSIG = 0x6054b50;
-
-    public static final int LOCHDR = 30, EXTHDR = 16, CENHDR = 46, ENDHDR = 22,
-            LOCVER = 4, LOCFLG = 6, LOCHOW = 8, LOCTIM = 10, LOCCRC = 14,
-            LOCSIZ = 18, LOCLEN = 22, LOCNAM = 26, LOCEXT = 28, EXTCRC = 4,
-            EXTSIZ = 8, EXTLEN = 12, CENVEM = 4, CENVER = 6, CENFLG = 8,
-            CENHOW = 10, CENTIM = 12, CENCRC = 16, CENSIZ = 20, CENLEN = 24,
-            CENNAM = 28, CENEXT = 30, CENCOM = 32, CENDSK = 34, CENATT = 36,
-            CENATX = 38, CENOFF = 42, ENDSUB = 8, ENDTOT = 10, ENDSIZ = 12,
-            ENDOFF = 16, ENDCOM = 20;
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipEntry.java b/libcore/archive/src/main/java/java/util/zip/ZipEntry.java
deleted file mode 100644
index 75466ce..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipEntry.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-import java.io.UnsupportedEncodingException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-/**
- * An instance of {@code ZipEntry} represents an entry within a <i>ZIP-archive</i>.
- * An entry has attributes such as name (= path) or the size of its data. While
- * an entry identifies data stored in an archive, it does not hold the data
- * itself. For example when reading a <i>ZIP-file</i> you will first retrieve
- * all its entries in a collection and then read the data for a specific entry
- * through an input stream.
- *
- * @see ZipFile
- * @see ZipOutputStream
- */
-public class ZipEntry implements ZipConstants, Cloneable {
-    String name, comment;
-
-    long compressedSize = -1, crc = -1, size = -1;
-
-    int compressionMethod = -1, time = -1, modDate = -1;
-
-    byte[] extra;
-
-    int nameLen = -1;
-    long mLocalHeaderRelOffset = -1;
-
-    /**
-     * Zip entry state: Deflated.
-     */
-    public static final int DEFLATED = 8;
-
-    /**
-     * Zip entry state: Stored.
-     */
-    public static final int STORED = 0;
-
-    /**
-     * Constructs a new {@code ZipEntry} with the specified name.
-     *
-     * @param name
-     *            the name of the ZIP entry.
-     * @throws IllegalArgumentException
-     *             if the name length is outside the range (> 0xFFFF).
-     */
-    public ZipEntry(String name) {
-        if (name == null) {
-            throw new NullPointerException();
-        }
-        if (name.length() > 0xFFFF) {
-            throw new IllegalArgumentException();
-        }
-        this.name = name;
-    }
-
-    /**
-     * Gets the comment for this {@code ZipEntry}.
-     *
-     * @return the comment for this {@code ZipEntry}, or {@code null} if there
-     *         is no comment. If we're reading an archive with
-     *         {@code ZipInputStream} the comment is not available.
-     */
-    public String getComment() {
-        return comment;
-    }
-
-    /**
-     * Gets the compressed size of this {@code ZipEntry}.
-     *
-     * @return the compressed size, or -1 if the compressed size has not been
-     *         set.
-     */
-    public long getCompressedSize() {
-        return compressedSize;
-    }
-
-    /**
-     * Gets the checksum for this {@code ZipEntry}.
-     *
-     * @return the checksum, or -1 if the checksum has not been set.
-     */
-    public long getCrc() {
-        return crc;
-    }
-
-    /**
-     * Gets the extra information for this {@code ZipEntry}.
-     *
-     * @return a byte array containing the extra information, or {@code null} if
-     *         there is none.
-     */
-    public byte[] getExtra() {
-        return extra;
-    }
-
-    /**
-     * Gets the compression method for this {@code ZipEntry}.
-     *
-     * @return the compression method, either {@code DEFLATED}, {@code STORED}
-     *         or -1 if the compression method has not been set.
-     */
-    public int getMethod() {
-        return compressionMethod;
-    }
-
-    /**
-     * Gets the name of this {@code ZipEntry}.
-     *
-     * @return the entry name.
-     */
-    public String getName() {
-        return name;
-    }
-
-    /**
-     * Gets the uncompressed size of this {@code ZipEntry}.
-     *
-     * @return the uncompressed size, or {@code -1} if the size has not been
-     *         set.
-     */
-    public long getSize() {
-        return size;
-    }
-
-    /**
-     * Gets the last modification time of this {@code ZipEntry}.
-     *
-     * @return the last modification time as the number of milliseconds since
-     *         Jan. 1, 1970.
-     */
-    public long getTime() {
-        if (time != -1) {
-            GregorianCalendar cal = new GregorianCalendar();
-            cal.set(Calendar.MILLISECOND, 0);
-            cal.set(1980 + ((modDate >> 9) & 0x7f), ((modDate >> 5) & 0xf) - 1,
-                    modDate & 0x1f, (time >> 11) & 0x1f, (time >> 5) & 0x3f,
-                    (time & 0x1f) << 1);
-            return cal.getTime().getTime();
-        }
-        return -1;
-    }
-
-    /**
-     * Determine whether or not this {@code ZipEntry} is a directory.
-     *
-     * @return {@code true} when this {@code ZipEntry} is a directory, {@code
-     *         false} otherwise.
-     */
-    public boolean isDirectory() {
-        return name.charAt(name.length() - 1) == '/';
-    }
-
-    /**
-     * Sets the comment for this {@code ZipEntry}.
-     *
-     * @param string
-     *            the comment for this entry.
-     */
-    public void setComment(String string) {
-        if (string == null || string.length() <= 0xFFFF) {
-            comment = string;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /**
-     * Sets the compressed size for this {@code ZipEntry}.
-     *
-     * @param value
-     *            the compressed size (in bytes).
-     */
-    public void setCompressedSize(long value) {
-        compressedSize = value;
-    }
-
-    /**
-     * Sets the checksum for this {@code ZipEntry}.
-     *
-     * @param value
-     *            the checksum for this entry.
-     * @throws IllegalArgumentException
-     *             if {@code value} is < 0 or > 0xFFFFFFFFL.
-     */
-    public void setCrc(long value) {
-        if (value >= 0 && value <= 0xFFFFFFFFL) {
-            crc = value;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /**
-     * Sets the extra information for this {@code ZipEntry}.
-     *
-     * @param data
-     *            a byte array containing the extra information.
-     * @throws IllegalArgumentException
-     *             when the length of data is greater than 0xFFFF bytes.
-     */
-    public void setExtra(byte[] data) {
-        if (data == null || data.length <= 0xFFFF) {
-            extra = data;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /**
-     * Sets the compression method for this {@code ZipEntry}.
-     *
-     * @param value
-     *            the compression method, either {@code DEFLATED} or {@code
-     *            STORED}.
-     * @throws IllegalArgumentException
-     *             when value is not {@code DEFLATED} or {@code STORED}.
-     */
-    public void setMethod(int value) {
-        if (value != STORED && value != DEFLATED) {
-            throw new IllegalArgumentException();
-        }
-        compressionMethod = value;
-    }
-
-    /**
-     * Sets the uncompressed size of this {@code ZipEntry}.
-     *
-     * @param value
-     *            the uncompressed size for this entry.
-     * @throws IllegalArgumentException
-     *             if {@code value} < 0 or {@code value} > 0xFFFFFFFFL.
-     */
-    public void setSize(long value) {
-        if (value >= 0 && value <= 0xFFFFFFFFL) {
-            size = value;
-        } else {
-            throw new IllegalArgumentException();
-        }
-    }
-
-    /**
-     * Sets the modification time of this {@code ZipEntry}.
-     *
-     * @param value
-     *            the modification time as the number of milliseconds since Jan.
-     *            1, 1970.
-     */
-    public void setTime(long value) {
-        GregorianCalendar cal = new GregorianCalendar();
-        cal.setTime(new Date(value));
-        int year = cal.get(Calendar.YEAR);
-        if (year < 1980) {
-            modDate = 0x21;
-            time = 0;
-        } else {
-            modDate = cal.get(Calendar.DATE);
-            modDate = (cal.get(Calendar.MONTH) + 1 << 5) | modDate;
-            modDate = ((cal.get(Calendar.YEAR) - 1980) << 9) | modDate;
-            time = cal.get(Calendar.SECOND) >> 1;
-            time = (cal.get(Calendar.MINUTE) << 5) | time;
-            time = (cal.get(Calendar.HOUR_OF_DAY) << 11) | time;
-        }
-    }
-
-    /**
-     * Returns the string representation of this {@code ZipEntry}.
-     *
-     * @return the string representation of this {@code ZipEntry}.
-     */
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    /**
-     * Constructs a new {@code ZipEntry} using the values obtained from {@code
-     * ze}.
-     *
-     * @param ze
-     *            the {@code ZipEntry} from which to obtain values.
-     */
-    public ZipEntry(ZipEntry ze) {
-        name = ze.name;
-        comment = ze.comment;
-        time = ze.time;
-        size = ze.size;
-        compressedSize = ze.compressedSize;
-        crc = ze.crc;
-        compressionMethod = ze.compressionMethod;
-        modDate = ze.modDate;
-        extra = ze.extra;
-        nameLen = ze.nameLen;
-        mLocalHeaderRelOffset = ze.mLocalHeaderRelOffset;
-    }
-
-    /**
-     * Returns a shallow copy of this entry.
-     *
-     * @return a copy of this entry.
-     */
-    @Override
-    public Object clone() {
-        return new ZipEntry(this);
-    }
-
-    /**
-     * Returns the hash code for this {@code ZipEntry}.
-     *
-     * @return the hash code of the entry.
-     */
-    @Override
-    public int hashCode() {
-        return name.hashCode();
-    }
-
-    /*
-     * Internal constructor.  Creates a new ZipEntry by reading the
-     * Central Directory Entry from "in", which must be positioned at
-     * the CDE signature.
-     *
-     * On exit, "in" will be positioned at the start of the next entry.
-     */
-    ZipEntry(LittleEndianReader ler, InputStream in) throws IOException {
-
-        /*
-         * We're seeing performance issues when we call readShortLE and
-         * readIntLE, so we're going to read the entire header at once
-         * and then parse the results out without using any function calls.
-         * Uglier, but should be much faster.
-         *
-         * Note that some lines look a bit different, because the corresponding
-         * fields or locals are long and so we need to do & 0xffffffffl to avoid
-         * problems induced by sign extension.
-         */
-
-        byte[] hdrBuf = ler.hdrBuf;
-        myReadFully(in, hdrBuf);
-
-        long sig = (hdrBuf[0] & 0xff) | ((hdrBuf[1] & 0xff) << 8) |
-            ((hdrBuf[2] & 0xff) << 16) | ((hdrBuf[3] << 24) & 0xffffffffL);
-        if (sig != CENSIG) {
-             throw new ZipException("Central Directory Entry not found");
-        }
-
-        compressionMethod = (hdrBuf[10] & 0xff) | ((hdrBuf[11] & 0xff) << 8);
-        time = (hdrBuf[12] & 0xff) | ((hdrBuf[13] & 0xff) << 8);
-        modDate = (hdrBuf[14] & 0xff) | ((hdrBuf[15] & 0xff) << 8);
-        crc = (hdrBuf[16] & 0xff) | ((hdrBuf[17] & 0xff) << 8)
-                | ((hdrBuf[18] & 0xff) << 16)
-                | ((hdrBuf[19] << 24) & 0xffffffffL);
-        compressedSize = (hdrBuf[20] & 0xff) | ((hdrBuf[21] & 0xff) << 8)
-                | ((hdrBuf[22] & 0xff) << 16)
-                | ((hdrBuf[23] << 24) & 0xffffffffL);
-        size = (hdrBuf[24] & 0xff) | ((hdrBuf[25] & 0xff) << 8)
-                | ((hdrBuf[26] & 0xff) << 16)
-                | ((hdrBuf[27] << 24) & 0xffffffffL);
-        nameLen = (hdrBuf[28] & 0xff) | ((hdrBuf[29] & 0xff) << 8);
-        int extraLen = (hdrBuf[30] & 0xff) | ((hdrBuf[31] & 0xff) << 8);
-        int commentLen = (hdrBuf[32] & 0xff) | ((hdrBuf[33] & 0xff) << 8);
-        mLocalHeaderRelOffset = (hdrBuf[42] & 0xff) | ((hdrBuf[43] & 0xff) << 8)
-                | ((hdrBuf[44] & 0xff) << 16)
-                | ((hdrBuf[45] << 24) & 0xffffffffL);
-
-        byte[] nameBytes = new byte[nameLen];
-        myReadFully(in, nameBytes);
-
-        byte[] commentBytes = null;
-        if (commentLen > 0) {
-            commentBytes = new byte[commentLen];
-            myReadFully(in, commentBytes);
-        }
-
-        if (extraLen > 0) {
-            extra = new byte[extraLen];
-            myReadFully(in, extra);
-        }
-
-        try {
-            /*
-             * The actual character set is "IBM Code Page 437".  As of
-             * Sep 2006, the Zip spec (APPNOTE.TXT) supports UTF-8.  When
-             * bit 11 of the GP flags field is set, the file name and
-             * comment fields are UTF-8.
-             *
-             * TODO: add correct UTF-8 support.
-             */
-            name = new String(nameBytes, "ISO-8859-1");
-            if (commentBytes != null) {
-                comment = new String(commentBytes, "ISO-8859-1");
-            } else {
-                comment = null;
-            }
-        } catch (UnsupportedEncodingException uee) {
-            throw new InternalError(uee.getMessage());
-        }
-    }
-
-    private void myReadFully(InputStream in, byte[] b) throws IOException {
-        int len = b.length;
-        int off = 0;
-
-        while (len > 0) {
-            int count = in.read(b, off, len);
-            if (count <= 0) {
-                throw new EOFException();
-            }
-            off += count;
-            len -= count;
-        }
-    }
-
-    /*
-     * Read a four-byte int in little-endian order.
-     */
-    static long readIntLE(RandomAccessFile raf) throws IOException {
-        int b0 = raf.read();
-        int b1 = raf.read();
-        int b2 = raf.read();
-        int b3 = raf.read();
-
-        if (b3 < 0) {
-            throw new EOFException("in ZipEntry.readIntLE(RandomAccessFile)");
-        }
-        return b0 | (b1 << 8) | (b2 << 16) | (b3 << 24); // ATTENTION: DOES SIGN EXTENSION: IS THIS WANTED?
-    }
-
-    static class LittleEndianReader {
-        private byte[] b = new byte[4];
-        byte[] hdrBuf = new byte[CENHDR];
-
-        /*
-         * Read a two-byte short in little-endian order.
-         */
-        int readShortLE(InputStream in) throws IOException {
-            if (in.read(b, 0, 2) == 2) {
-                return (b[0] & 0XFF) | ((b[1] & 0XFF) << 8);
-            } else {
-                throw new EOFException("in ZipEntry.readShortLE(InputStream)");
-            }
-        }
-
-        /*
-         * Read a four-byte int in little-endian order.
-         */
-        long readIntLE(InputStream in) throws IOException {
-            if (in.read(b, 0, 4) == 4) {
-                return (   ((b[0] & 0XFF))
-                         | ((b[1] & 0XFF) << 8)
-                         | ((b[2] & 0XFF) << 16)
-                         | ((b[3] & 0XFF) << 24))
-                       & 0XFFFFFFFFL; // Here for sure NO sign extension is wanted.
-            } else {
-                throw new EOFException("in ZipEntry.readIntLE(InputStream)");
-            }
-        }
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipException.java b/libcore/archive/src/main/java/java/util/zip/ZipException.java
deleted file mode 100644
index ad68714..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.IOException;
-
-/**
- * This runtime exception is thrown by {@code ZipFile} and {@code
- * ZipInputStream} when the file or stream is not a valid ZIP file.
- *
- * @see ZipFile
- * @see ZipInputStream
- */
-public class ZipException extends IOException {
-
-    private static final long serialVersionUID = 8000196834066748623L;
-
-    /**
-     * Constructs a new {@code ZipException} instance.
-     */
-    public ZipException() {
-        super();
-    }
-
-    /**
-     * Constructs a new {@code ZipException} instance with the specified
-     * message.
-     *
-     * @param detailMessage
-     *            the detail message for the exception.
-     */
-    public ZipException(String detailMessage) {
-        super(detailMessage);
-    }
-
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipFile.java b/libcore/archive/src/main/java/java/util/zip/ZipFile.java
deleted file mode 100644
index 48541e1..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipFile.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Enumeration;
-import java.util.LinkedHashMap;
-import java.util.Iterator;
-
-/**
- * This class provides random read access to a <i>ZIP-archive</i> file.
- * <p>
- * While {@code ZipInputStream} provides stream based read access to a
- * <i>ZIP-archive</i>, this class implements more efficient (file based) access
- * and makes use of the <i>central directory</i> within a <i>ZIP-archive</i>.
- * <p>
- * Use {@code ZipOutputStream} if you want to create an archive.
- * <p>
- * A temporary ZIP file can be marked for automatic deletion upon closing it.
- *
- * @see ZipEntry
- * @see ZipOutputStream
- */
-public class ZipFile implements ZipConstants {
-
-    /**
-     * Open ZIP file for read.
-     */
-    public static final int OPEN_READ = 1;
-
-    /**
-     * Delete ZIP file when closed.
-     */
-    public static final int OPEN_DELETE = 4;
-
-    private final String fileName;
-
-    private File fileToDeleteOnClose;
-
-    private RandomAccessFile mRaf;
-
-    private final ZipEntry.LittleEndianReader ler = new ZipEntry.LittleEndianReader();
-
-    private final LinkedHashMap<String, ZipEntry> mEntries
-            = new LinkedHashMap<String, ZipEntry>();
-
-    /**
-     * Constructs a new {@code ZipFile} with the specified file.
-     *
-     * @param file
-     *            the file to read from.
-     * @throws ZipException
-     *             if a ZIP error occurs.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public ZipFile(File file) throws ZipException, IOException {
-        this(file, OPEN_READ);
-    }
-
-    /**
-     * Opens a file as <i>ZIP-archive</i>. "mode" must be {@code OPEN_READ} or
-     * {@code OPEN_DELETE} . The latter sets the "delete on exit" flag through a
-     * file.
-     *
-     * @param file
-     *            the ZIP file to read.
-     * @param mode
-     *            the mode of the file open operation.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public ZipFile(File file, int mode) throws IOException {
-        fileName = file.getPath();
-        if (mode != OPEN_READ && mode != (OPEN_READ | OPEN_DELETE)) {
-            throw new IllegalArgumentException();
-        }
-
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(fileName);
-        }
-        if ((mode & OPEN_DELETE) != 0) {
-            if (security != null) {
-                security.checkDelete(fileName);
-            }
-            fileToDeleteOnClose = file; // file.deleteOnExit();
-        } else {
-            fileToDeleteOnClose = null;
-        }
-
-        mRaf = new RandomAccessFile(fileName, "r");
-
-        readCentralDir();
-    }
-
-    /**
-     * Opens a ZIP archived file.
-     *
-     * @param name
-     *            the name of the ZIP file.
-     * @throws IOException
-     *             if an IOException occurs.
-     */
-    public ZipFile(String name) throws IOException {
-        this(new File(name), OPEN_READ);
-    }
-
-    @Override
-    protected void finalize() throws IOException {
-        close();
-    }
-
-    /**
-     * Closes this ZIP file. This method is idempotent.
-     *
-     * @throws IOException
-     *             if an IOException occurs.
-     */
-    public void close() throws IOException {
-        RandomAccessFile raf = mRaf;
-
-        if (raf != null) { // Only close initialized instances
-            synchronized(raf) {
-                mRaf = null;
-                raf.close();
-            }
-            if (fileToDeleteOnClose != null) {
-                AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        new File(fileName).delete();
-                        return null;
-                    }
-                });
-                // fileToDeleteOnClose.delete();
-                fileToDeleteOnClose = null;
-            }
-        }
-    }
-
-    private void checkNotClosed() {
-        if (mRaf == null) {
-            throw new IllegalStateException("Zip File closed.");
-        }
-    }
-
-    /**
-     * Returns an enumeration of the entries. The entries are listed in the
-     * order in which they appear in the ZIP archive.
-     *
-     * @return the enumeration of the entries.
-     * @throws IllegalStateException if this ZIP file has been closed.
-     */
-    public Enumeration<? extends ZipEntry> entries() {
-        checkNotClosed();
-        final Iterator<ZipEntry> iterator = mEntries.values().iterator();
-
-        return new Enumeration<ZipEntry>() {
-            public boolean hasMoreElements() {
-                checkNotClosed();
-                return iterator.hasNext();
-            }
-
-            public ZipEntry nextElement() {
-                checkNotClosed();
-                return iterator.next();
-            }
-        };
-    }
-
-    /**
-     * Gets the ZIP entry with the specified name from this {@code ZipFile}.
-     *
-     * @param entryName
-     *            the name of the entry in the ZIP file.
-     * @return a {@code ZipEntry} or {@code null} if the entry name does not
-     *         exist in the ZIP file.
-     * @throws IllegalStateException if this ZIP file has been closed.
-     */
-    public ZipEntry getEntry(String entryName) {
-        checkNotClosed();
-        if (entryName == null) {
-            throw new NullPointerException();
-        }
-
-        ZipEntry ze = mEntries.get(entryName);
-        if (ze == null) {
-            ze = mEntries.get(entryName + "/");
-        }
-        return ze;
-    }
-
-    /**
-     * Returns an input stream on the data of the specified {@code ZipEntry}.
-     *
-     * @param entry
-     *            the ZipEntry.
-     * @return an input stream of the data contained in the {@code ZipEntry}.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     * @throws IllegalStateException if this ZIP file has been closed.
-     */
-    public InputStream getInputStream(ZipEntry entry) throws IOException {
-        /*
-         * Make sure this ZipEntry is in this Zip file.  We run it through
-         * the name lookup.
-         */
-        entry = getEntry(entry.getName());
-        if (entry == null) {
-            return null;
-        }
-
-        /*
-         * Create a ZipInputStream at the right part of the file.
-         */
-        RandomAccessFile raf = mRaf;
-        synchronized (raf) {
-            // We don't know the entry data's start position. All we have is the
-            // position of the entry's local header. At position 28 we find the
-            // length of the extra data. In some cases this length differs from
-            // the one coming in the central header.
-            RAFStream rafstrm = new RAFStream(raf,
-                    entry.mLocalHeaderRelOffset + 28);
-            int localExtraLenOrWhatever = ler.readShortLE(rafstrm);
-            // Skip the name and this "extra" data or whatever it is:
-            rafstrm.skip(entry.nameLen + localExtraLenOrWhatever);
-            rafstrm.mLength = rafstrm.mOffset + entry.compressedSize;
-            if (entry.compressionMethod == ZipEntry.DEFLATED) {
-                int bufSize = Math.max(1024, (int)Math.min(entry.getSize(), 65535L));
-                return new ZipInflaterInputStream(rafstrm, new Inflater(true), bufSize, entry);
-            } else {
-                return rafstrm;
-            }
-        }
-    }
-
-    /**
-     * Gets the file name of this {@code ZipFile}.
-     *
-     * @return the file name of this {@code ZipFile}.
-     */
-    public String getName() {
-        return fileName;
-    }
-
-    /**
-     * Returns the number of {@code ZipEntries} in this {@code ZipFile}.
-     *
-     * @return the number of entries in this file.
-     * @throws IllegalStateException if this ZIP file has been closed.
-     */
-    public int size() {
-        checkNotClosed();
-        return mEntries.size();
-    }
-
-    /**
-     * Find the central directory and read the contents.
-     *
-     * <p>The central directory can be followed by a variable-length comment
-     * field, so we have to scan through it backwards.  The comment is at
-     * most 64K, plus we have 18 bytes for the end-of-central-dir stuff
-     * itself, plus apparently sometimes people throw random junk on the end
-     * just for the fun of it.
-     *
-     * <p>This is all a little wobbly.  If the wrong value ends up in the EOCD
-     * area, we're hosed. This appears to be the way that everybody handles
-     * it though, so we're in good company if this fails.
-     */
-    private void readCentralDir() throws IOException {
-        /*
-         * Scan back, looking for the End Of Central Directory field.  If
-         * the archive doesn't have a comment, we'll hit it on the first
-         * try.
-         *
-         * No need to synchronize mRaf here -- we only do this when we
-         * first open the Zip file.
-         */
-        long scanOffset = mRaf.length() - ENDHDR;
-        if (scanOffset < 0) {
-            throw new ZipException("too short to be Zip");
-        }
-
-        long stopOffset = scanOffset - 65536;
-        if (stopOffset < 0) {
-            stopOffset = 0;
-        }
-
-        while (true) {
-            mRaf.seek(scanOffset);
-            if (ZipEntry.readIntLE(mRaf) == 101010256L) {
-                break;
-            }
-
-            scanOffset--;
-            if (scanOffset < stopOffset) {
-                throw new ZipException("EOCD not found; not a Zip archive?");
-            }
-        }
-
-        /*
-         * Found it, read the EOCD.
-         *
-         * For performance we want to use buffered I/O when reading the
-         * file.  We wrap a buffered stream around the random-access file
-         * object.  If we just read from the RandomAccessFile we'll be
-         * doing a read() system call every time.
-         */
-        RAFStream rafs = new RAFStream(mRaf, mRaf.getFilePointer());
-        BufferedInputStream bin = new BufferedInputStream(rafs, ENDHDR);
-
-        int diskNumber = ler.readShortLE(bin);
-        int diskWithCentralDir = ler.readShortLE(bin);
-        int numEntries = ler.readShortLE(bin);
-        int totalNumEntries = ler.readShortLE(bin);
-        /*centralDirSize =*/ ler.readIntLE(bin);
-        long centralDirOffset = ler.readIntLE(bin);
-        /*commentLen =*/ ler.readShortLE(bin);
-
-        if (numEntries != totalNumEntries ||
-            diskNumber != 0 ||
-            diskWithCentralDir != 0) {
-            throw new ZipException("spanned archives not supported");
-        }
-
-        /*
-         * Seek to the first CDE and read all entries.
-         */
-        rafs = new RAFStream(mRaf, centralDirOffset);
-        bin = new BufferedInputStream(rafs, 4096);
-        for (int i = 0; i < numEntries; i++) {
-            ZipEntry newEntry = new ZipEntry(ler, bin);
-            mEntries.put(newEntry.getName(), newEntry);
-        }
-    }
-
-    /**
-     * Wrap a stream around a RandomAccessFile.  The RandomAccessFile is shared
-     * among all streams returned by getInputStream(), so we have to synchronize
-     * access to it.  (We can optimize this by adding buffering here to reduce
-     * collisions.)
-     *
-     * <p>We could support mark/reset, but we don't currently need them.
-     */
-    static class RAFStream extends InputStream {
-
-        RandomAccessFile mSharedRaf;
-        long mOffset;
-        long mLength;
-
-        public RAFStream(RandomAccessFile raf, long pos) throws IOException {
-            mSharedRaf = raf;
-            mOffset = pos;
-            mLength = raf.length();
-        }
-
-        @Override
-        public int available() throws IOException {
-            return (mOffset < mLength ? 1 : 0);
-        }
-
-        @Override
-        public int read() throws IOException {
-            byte[] singleByteBuf = new byte[1];
-            if (read(singleByteBuf, 0, 1) == 1) {
-                return singleByteBuf[0] & 0XFF;
-            } else {
-                return -1;
-            }
-        }
-
-        @Override
-        public int read(byte[] b, int off, int len) throws IOException {
-            synchronized (mSharedRaf) {
-                mSharedRaf.seek(mOffset);
-                if (len > mLength - mOffset) {
-                    len = (int) (mLength - mOffset);
-                }
-                int count = mSharedRaf.read(b, off, len);
-                if (count > 0) {
-                    mOffset += count;
-                    return count;
-                } else {
-                    return -1;
-                }
-            }
-        }
-
-        @Override
-        public long skip(long n) throws IOException {
-            if (n > mLength - mOffset) {
-                n = mLength - mOffset;
-            }
-            mOffset += n;
-            return n;
-        }
-    }
-    
-    static class ZipInflaterInputStream extends InflaterInputStream {
-
-        ZipEntry entry;
-        long bytesRead = 0;
-
-        public ZipInflaterInputStream(InputStream is, Inflater inf, int bsize, ZipEntry entry) {
-            super(is, inf, bsize);
-            this.entry = entry;
-        }
-
-        @Override
-        public int read(byte[] buffer, int off, int nbytes) throws IOException {
-            int i = super.read(buffer, off, nbytes);
-            if (i != -1) {
-                bytesRead += i;
-            }
-            return i;
-        }
-
-        @Override
-        public int available() throws IOException {
-            return super.available() == 0 ? 0 : (int) (entry.getSize() - bytesRead);
-        }
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipInputStream.java b/libcore/archive/src/main/java/java/util/zip/ZipInputStream.java
deleted file mode 100644
index e547612..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipInputStream.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.luni.util.Util;
-
-/**
- * This class provides an implementation of {@code FilterInputStream} that
- * uncompresses data from a <i>ZIP-archive</i> input stream.
- * <p>
- * A <i>ZIP-archive</i> is a collection of compressed (or uncompressed) files -
- * the so called ZIP entries. Therefore when reading from a {@code
- * ZipInputStream} first the entry's attributes will be retrieved with {@code
- * getNextEntry} before its data is read.
- * <p>
- * While {@code InflaterInputStream} can read a compressed <i>ZIP-archive</i>
- * entry, this extension can read uncompressed entries as well.
- * <p>
- * Use {@code ZipFile} if you can access the archive as a file directly.
- *
- * @see ZipEntry
- * @see ZipFile
- */
-public class ZipInputStream extends InflaterInputStream implements ZipConstants {
-    static final int DEFLATED = 8;
-
-    static final int STORED = 0;
-
-    static final int ZIPDataDescriptorFlag = 8;
-
-    static final int ZIPLocalHeaderVersionNeeded = 20;
-
-    private boolean entriesEnd = false;
-
-    private boolean hasDD = false;
-
-    private int entryIn = 0;
-
-    private int inRead, lastRead = 0;
-
-    ZipEntry currentEntry;
-
-    private final byte[] hdrBuf = new byte[LOCHDR - LOCVER];
-
-    private final CRC32 crc = new CRC32();
-
-    private byte[] nameBuf = new byte[256];
-
-    private char[] charBuf = new char[256];
-
-    /**
-     * Constructs a new {@code ZipInputStream} from the specified input stream.
-     *
-     * @param stream
-     *            the input stream to representing a ZIP archive.
-     */
-    public ZipInputStream(InputStream stream) {
-        super(new PushbackInputStream(stream, BUF_SIZE), new Inflater(true));
-        if (stream == null) {
-            throw new NullPointerException();
-        }
-    }
-
-    /**
-     * Closes this {@code ZipInputStream}.
-     *
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    @Override
-    public void close() throws IOException {
-        if (!closed) {
-            closeEntry(); // Close the current entry
-            super.close();
-        }
-    }
-
-    /**
-     * Closes the current ZIP entry and positions to read the next entry.
-     *
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    public void closeEntry() throws IOException {
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (currentEntry == null) {
-            return;
-        }
-        if (currentEntry instanceof java.util.jar.JarEntry) {
-            Attributes temp = ((JarEntry) currentEntry).getAttributes();
-            if (temp != null && temp.containsKey("hidden")) { //$NON-NLS-1$
-                return;
-            }
-        }
-
-        /*
-         * The following code is careful to leave the ZipInputStream in a
-         * consistent state, even when close() results in an exception. It does
-         * so by:
-         *  - pushing bytes back into the source stream
-         *  - reading a data descriptor footer from the source stream
-         *  - resetting fields that manage the entry being closed
-         */
-
-        // Ensure all entry bytes are read
-        Exception failure = null;
-        try {
-            skip(Long.MAX_VALUE);
-        } catch (Exception e) {
-            failure = e;
-        }
-
-        int inB, out;
-        if (currentEntry.compressionMethod == DEFLATED) {
-            inB = inf.getTotalIn();
-            out = inf.getTotalOut();
-        } else {
-            inB = inRead;
-            out = inRead;
-        }
-        int diff = entryIn - inB;
-        // Pushback any required bytes
-        if (diff != 0) {
-            ((PushbackInputStream) in).unread(buf, len - diff, diff);
-        }
-
-        try {
-            readAndVerifyDataDescriptor(inB, out);
-        } catch (Exception e) {
-            if (failure == null) { // otherwise we're already going to throw
-                failure = e;
-            }
-        }
-
-        inf.reset();
-        lastRead = inRead = entryIn = len = 0;
-        crc.reset();
-        currentEntry = null;
-
-        if (failure != null) {
-            if (failure instanceof IOException) {
-                throw (IOException) failure;
-            } else if (failure instanceof RuntimeException) {
-                throw (RuntimeException) failure;
-            }
-            AssertionError error = new AssertionError();
-            error.initCause(failure);
-            throw error;
-        }
-    }
-
-    private void readAndVerifyDataDescriptor(int inB, int out) throws IOException {
-        if (hasDD) {
-            in.read(hdrBuf, 0, EXTHDR);
-            if (getLong(hdrBuf, 0) != EXTSIG) {
-                throw new ZipException(Messages.getString("archive.1F")); //$NON-NLS-1$
-            }
-            currentEntry.crc = getLong(hdrBuf, EXTCRC);
-            currentEntry.compressedSize = getLong(hdrBuf, EXTSIZ);
-            currentEntry.size = getLong(hdrBuf, EXTLEN);
-        }
-        if (currentEntry.crc != crc.getValue()) {
-            throw new ZipException(Messages.getString("archive.20")); //$NON-NLS-1$
-        }
-        if (currentEntry.compressedSize != inB || currentEntry.size != out) {
-            throw new ZipException(Messages.getString("archive.21")); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Reads the next entry from this {@code ZipInputStream} or {@code null} if
-     * no more entries are present.
-     *
-     * @return the next {@code ZipEntry} contained in the input stream.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     * @see ZipEntry
-     */
-    public ZipEntry getNextEntry() throws IOException {
-        closeEntry();
-        if (entriesEnd) {
-            return null;
-        }
-
-        int x = 0, count = 0;
-        while (count != 4) {
-            count += x = in.read(hdrBuf, count, 4 - count);
-            if (x == -1) {
-                return null;
-            }
-        }
-        long hdr = getLong(hdrBuf, 0);
-        if (hdr == CENSIG) {
-            entriesEnd = true;
-            return null;
-        }
-        if (hdr != LOCSIG) {
-            return null;
-        }
-
-        // Read the local header
-        count = 0;
-        while (count != (LOCHDR - LOCVER)) {
-            count += x = in.read(hdrBuf, count, (LOCHDR - LOCVER) - count);
-            if (x == -1) {
-                throw new EOFException();
-            }
-        }
-        int version = getShort(hdrBuf, 0) & 0xff;
-        if (version > ZIPLocalHeaderVersionNeeded) {
-            throw new ZipException(Messages.getString("archive.22")); //$NON-NLS-1$
-        }
-        int flags = getShort(hdrBuf, LOCFLG - LOCVER);
-        hasDD = ((flags & ZIPDataDescriptorFlag) == ZIPDataDescriptorFlag);
-        int cetime = getShort(hdrBuf, LOCTIM - LOCVER);
-        int cemodDate = getShort(hdrBuf, LOCTIM - LOCVER + 2);
-        int cecompressionMethod = getShort(hdrBuf, LOCHOW - LOCVER);
-        long cecrc = 0, cecompressedSize = 0, cesize = -1;
-        if (!hasDD) {
-            cecrc = getLong(hdrBuf, LOCCRC - LOCVER);
-            cecompressedSize = getLong(hdrBuf, LOCSIZ - LOCVER);
-            cesize = getLong(hdrBuf, LOCLEN - LOCVER);
-        }
-        int flen = getShort(hdrBuf, LOCNAM - LOCVER);
-        if (flen == 0) {
-            throw new ZipException(Messages.getString("archive.23")); //$NON-NLS-1$
-        }
-        int elen = getShort(hdrBuf, LOCEXT - LOCVER);
-
-        count = 0;
-        if (flen > nameBuf.length) {
-            nameBuf = new byte[flen];
-            charBuf = new char[flen];
-        }
-        while (count != flen) {
-            count += x = in.read(nameBuf, count, flen - count);
-            if (x == -1) {
-                throw new EOFException();
-            }
-        }
-        currentEntry = createZipEntry(Util.convertUTF8WithBuf(nameBuf, charBuf,
-                0, flen));
-        currentEntry.time = cetime;
-        currentEntry.modDate = cemodDate;
-        currentEntry.setMethod(cecompressionMethod);
-        if (cesize != -1) {
-            currentEntry.setCrc(cecrc);
-            currentEntry.setSize(cesize);
-            currentEntry.setCompressedSize(cecompressedSize);
-        }
-        if (elen > 0) {
-            count = 0;
-            byte[] e = new byte[elen];
-            while (count != elen) {
-                count += x = in.read(e, count, elen - count);
-                if (x == -1) {
-                    throw new EOFException();
-                }
-            }
-            currentEntry.setExtra(e);
-        }
-        return currentEntry;
-    }
-
-    /* Read 4 bytes from the buffer and store it as an int */
-
-    /**
-     * Reads up to the specified number of uncompressed bytes into the buffer
-     * starting at the offset.
-     *
-     * @param buffer
-     *            a byte array
-     * @param start
-     *            the starting offset into the buffer
-     * @param length
-     *            the number of bytes to read
-     * @return the number of bytes read
-     */
-    @Override
-    public int read(byte[] buffer, int start, int length) throws IOException {
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (inf.finished() || currentEntry == null) {
-            return -1;
-        }
-        // avoid int overflow, check null buffer
-        if (start > buffer.length || length < 0 || start < 0
-                || buffer.length - start < length) {
-            throw new ArrayIndexOutOfBoundsException();
-        }
-
-        if (currentEntry.compressionMethod == STORED) {
-            int csize = (int) currentEntry.size;
-            if (inRead >= csize) {
-                return -1;
-            }
-            if (lastRead >= len) {
-                lastRead = 0;
-                if ((len = in.read(buf)) == -1) {
-                    eof = true;
-                    return -1;
-                }
-                entryIn += len;
-            }
-            int toRead = length > (len - lastRead) ? len - lastRead : length;
-            if ((csize - inRead) < toRead) {
-                toRead = csize - inRead;
-            }
-            System.arraycopy(buf, lastRead, buffer, start, toRead);
-            lastRead += toRead;
-            inRead += toRead;
-            crc.update(buffer, start, toRead);
-            return toRead;
-        }
-        if (inf.needsInput()) {
-            fill();
-            if (len > 0) {
-                entryIn += len;
-            }
-        }
-        int read;
-        try {
-            read = inf.inflate(buffer, start, length);
-        } catch (DataFormatException e) {
-            throw new ZipException(e.getMessage());
-        }
-        if (read == 0 && inf.finished()) {
-            return -1;
-        }
-        crc.update(buffer, start, read);
-        return read;
-    }
-
-    /**
-     * Skips up to the specified number of bytes in the current ZIP entry.
-     *
-     * @param value
-     *            the number of bytes to skip.
-     * @return the number of bytes skipped.
-     * @throws IOException
-     *             if an {@code IOException} occurs.
-     */
-    @Override
-    public long skip(long value) throws IOException {
-        if (value < 0) {
-            throw new IllegalArgumentException();
-        }
-
-        long skipped = 0;
-        byte[] b = new byte[(int)Math.min(value, 2048L)];
-        while (skipped != value) {
-            long rem = value - skipped;
-            int x = read(b, 0, (int) (b.length > rem ? rem : b.length));
-            if (x == -1) {
-                return skipped;
-            }
-            skipped += x;
-        }
-        return skipped;
-    }
-
-    @Override
-    public int available() throws IOException {
-        if (closed) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        // The InflaterInputStream contract says we must only return 0 or 1.
-        return (currentEntry == null || inRead < currentEntry.size) ? 1 : 0;
-    }
-
-    /**
-     * creates a {@link ZipEntry } with the given name.
-     *
-     * @param name
-     *            the name of the entry.
-     * @return the created {@code ZipEntry}.
-     */
-    protected ZipEntry createZipEntry(String name) {
-        return new ZipEntry(name);
-    }
-
-    private int getShort(byte[] buffer, int off) {
-        return (buffer[off] & 0xFF) | ((buffer[off + 1] & 0xFF) << 8);
-    }
-
-    private long getLong(byte[] buffer, int off) {
-        long l = 0;
-        l |= (buffer[off] & 0xFF);
-        l |= (buffer[off + 1] & 0xFF) << 8;
-        l |= (buffer[off + 2] & 0xFF) << 16;
-        l |= ((long) (buffer[off + 3] & 0xFF)) << 24;
-        return l;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/ZipOutputStream.java b/libcore/archive/src/main/java/java/util/zip/ZipOutputStream.java
deleted file mode 100644
index 21b4221..0000000
--- a/libcore/archive/src/main/java/java/util/zip/ZipOutputStream.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.apache.harmony.archive.internal.nls.Messages;
-
-/**
- * This class provides an implementation of {@code FilterOutputStream} that
- * compresses data entries into a <i>ZIP-archive</i> output stream.
- * <p>
- * {@code ZipOutputStream} is used to write {@code ZipEntries} to the underlying
- * stream. Output from {@code ZipOutputStream} conforms to the {@code ZipFile}
- * file format.
- * <p>
- * While {@code DeflaterOutputStream} can write a compressed <i>ZIP-archive</i>
- * entry, this extension can write uncompressed entries as well. In this case
- * special rules apply, for this purpose refer to the <a
- * href="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">file format
- * specification</a>.
- *
- * @see ZipEntry
- * @see ZipFile
- */
-public class ZipOutputStream extends DeflaterOutputStream implements
-        ZipConstants {
-
-    /**
-     * Indicates deflated entries.
-     */
-    public static final int DEFLATED = 8;
-
-    /**
-     * Indicates uncompressed entries.
-     */
-    public static final int STORED = 0;
-
-    static final int ZIPDataDescriptorFlag = 8;
-
-    static final int ZIPLocalHeaderVersionNeeded = 20;
-
-    private String comment;
-
-    private final Vector<String> entries = new Vector<String>();
-
-    private int compressMethod = DEFLATED;
-
-    private int compressLevel = Deflater.DEFAULT_COMPRESSION;
-
-    private ByteArrayOutputStream cDir = new ByteArrayOutputStream();
-
-    private ZipEntry currentEntry;
-
-    private final CRC32 crc = new CRC32();
-
-    private int offset = 0, curOffset = 0, nameLength;
-
-    private byte[] nameBytes;
-
-    /**
-     * Constructs a new {@code ZipOutputStream} with the specified output
-     * stream.
-     *
-     * @param p1
-     *            the {@code OutputStream} to write the data to.
-     */
-    public ZipOutputStream(OutputStream p1) {
-        super(p1, new Deflater(Deflater.DEFAULT_COMPRESSION, true));
-    }
-
-    /**
-     * Closes the current {@code ZipEntry}, if any, and the underlying output
-     * stream. If the stream is already closed this method does nothing.
-     *
-     * @throws IOException
-     *             If an error occurs closing the stream.
-     */
-    @Override
-    public void close() throws IOException {
-        if (out != null) {
-            finish();
-            out.close();
-            out = null;
-        }
-    }
-
-    /**
-     * Closes the current {@code ZipEntry}. Any entry terminal data is written
-     * to the underlying stream.
-     *
-     * @throws IOException
-     *             If an error occurs closing the entry.
-     */
-    public void closeEntry() throws IOException {
-        if (cDir == null) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (currentEntry == null) {
-            return;
-        }
-        if (currentEntry.getMethod() == DEFLATED) {
-            super.finish();
-        }
-
-        // Verify values for STORED types
-        if (currentEntry.getMethod() == STORED) {
-            if (crc.getValue() != currentEntry.crc) {
-                throw new ZipException(Messages.getString("archive.20")); //$NON-NLS-1$
-            }
-            if (currentEntry.size != crc.tbytes) {
-                throw new ZipException(Messages.getString("archive.21")); //$NON-NLS-1$
-            }
-        }
-        curOffset = LOCHDR;
-
-        // Write the DataDescriptor
-        if (currentEntry.getMethod() != STORED) {
-            curOffset += EXTHDR;
-            writeLong(out, EXTSIG);
-            writeLong(out, currentEntry.crc = crc.getValue());
-            writeLong(out, currentEntry.compressedSize = def.getTotalOut());
-            writeLong(out, currentEntry.size = def.getTotalIn());
-        }
-        // Update the CentralDirectory
-        writeLong(cDir, CENSIG);
-        writeShort(cDir, ZIPLocalHeaderVersionNeeded); // Version created
-        writeShort(cDir, ZIPLocalHeaderVersionNeeded); // Version to extract
-        writeShort(cDir, currentEntry.getMethod() == STORED ? 0
-                : ZIPDataDescriptorFlag);
-        writeShort(cDir, currentEntry.getMethod());
-        writeShort(cDir, currentEntry.time);
-        writeShort(cDir, currentEntry.modDate);
-        writeLong(cDir, crc.getValue());
-        if (currentEntry.getMethod() == DEFLATED) {
-            curOffset += writeLong(cDir, def.getTotalOut());
-            writeLong(cDir, def.getTotalIn());
-        } else {
-            curOffset += writeLong(cDir, crc.tbytes);
-            writeLong(cDir, crc.tbytes);
-        }
-        curOffset += writeShort(cDir, nameLength);
-        if (currentEntry.extra != null) {
-            curOffset += writeShort(cDir, currentEntry.extra.length);
-        } else {
-            writeShort(cDir, 0);
-        }
-        String c;
-        if ((c = currentEntry.getComment()) != null) {
-            writeShort(cDir, c.length());
-        } else {
-            writeShort(cDir, 0);
-        }
-        writeShort(cDir, 0); // Disk Start
-        writeShort(cDir, 0); // Internal File Attributes
-        writeLong(cDir, 0); // External File Attributes
-        writeLong(cDir, offset);
-        cDir.write(nameBytes);
-        nameBytes = null;
-        if (currentEntry.extra != null) {
-            cDir.write(currentEntry.extra);
-        }
-        offset += curOffset;
-        if (c != null) {
-            cDir.write(c.getBytes());
-        }
-        currentEntry = null;
-        crc.reset();
-        def.reset();
-        done = false;
-    }
-
-    /**
-     * Indicates that all entries have been written to the stream. Any terminal
-     * information is written to the underlying stream.
-     *
-     * @throws IOException
-     *             if an error occurs while terminating the stream.
-     */
-    @Override
-    public void finish() throws IOException {
-        if (out == null) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (cDir == null) {
-            return;
-        }
-        if (entries.size() == 0) {
-            throw new ZipException(Messages.getString("archive.28")); //$NON-NLS-1$;
-        }
-        if (currentEntry != null) {
-            closeEntry();
-        }
-        int cdirSize = cDir.size();
-        // Write Central Dir End
-        writeLong(cDir, ENDSIG);
-        writeShort(cDir, 0); // Disk Number
-        writeShort(cDir, 0); // Start Disk
-        writeShort(cDir, entries.size()); // Number of entries
-        writeShort(cDir, entries.size()); // Number of entries
-        writeLong(cDir, cdirSize); // Size of central dir
-        writeLong(cDir, offset); // Offset of central dir
-        if (comment != null) {
-            writeShort(cDir, comment.length());
-            cDir.write(comment.getBytes());
-        } else {
-            writeShort(cDir, 0);
-        }
-        // Write the central dir
-        out.write(cDir.toByteArray());
-        cDir = null;
-
-    }
-
-    /**
-     * Writes entry information to the underlying stream. Data associated with
-     * the entry can then be written using {@code write()}. After data is
-     * written {@code closeEntry()} must be called to complete the writing of
-     * the entry to the underlying stream.
-     *
-     * @param ze
-     *            the {@code ZipEntry} to store.
-     * @throws IOException
-     *             If an error occurs storing the entry.
-     * @see #write
-     */
-    public void putNextEntry(ZipEntry ze) throws java.io.IOException {
-        if (currentEntry != null) {
-            closeEntry();
-        }
-        if (ze.getMethod() == STORED
-                || (compressMethod == STORED && ze.getMethod() == -1)) {
-            if (ze.crc == -1) {
-                /* [MSG "archive.20", "Crc mismatch"] */
-                throw new ZipException(Messages.getString("archive.20")); //$NON-NLS-1$
-            }
-            if (ze.size == -1 && ze.compressedSize == -1) {
-                /* [MSG "archive.21", "Size mismatch"] */
-                throw new ZipException(Messages.getString("archive.21")); //$NON-NLS-1$
-            }
-            if (ze.size != ze.compressedSize && ze.compressedSize != -1
-                    && ze.size != -1) {
-                /* [MSG "archive.21", "Size mismatch"] */
-                throw new ZipException(Messages.getString("archive.21")); //$NON-NLS-1$
-            }
-        }
-        /* [MSG "archive.1E", "Stream is closed"] */
-        if (cDir == null) {
-            throw new IOException(Messages.getString("archive.1E")); //$NON-NLS-1$
-        }
-        if (entries.contains(ze.name)) {
-            /* [MSG "archive.29", "Entry already exists: {0}"] */
-            throw new ZipException(Messages.getString("archive.29", ze.name)); //$NON-NLS-1$
-        }
-        nameLength = utf8Count(ze.name);
-        if (nameLength > 0xffff) {
-            /* [MSG "archive.2A", "Name too long: {0}"] */
-            throw new IllegalArgumentException(Messages.getString(
-                    "archive.2A", ze.name)); //$NON-NLS-1$
-        }
-
-        def.setLevel(compressLevel);
-        currentEntry = ze;
-        entries.add(currentEntry.name);
-        if (currentEntry.getMethod() == -1) {
-            currentEntry.setMethod(compressMethod);
-        }
-        writeLong(out, LOCSIG); // Entry header
-        writeShort(out, ZIPLocalHeaderVersionNeeded); // Extraction version
-        writeShort(out, currentEntry.getMethod() == STORED ? 0
-                : ZIPDataDescriptorFlag);
-        writeShort(out, currentEntry.getMethod());
-        if (currentEntry.getTime() == -1) {
-            currentEntry.setTime(System.currentTimeMillis());
-        }
-        writeShort(out, currentEntry.time);
-        writeShort(out, currentEntry.modDate);
-
-        if (currentEntry.getMethod() == STORED) {
-            if (currentEntry.size == -1) {
-                currentEntry.size = currentEntry.compressedSize;
-            } else if (currentEntry.compressedSize == -1) {
-                currentEntry.compressedSize = currentEntry.size;
-            }
-            writeLong(out, currentEntry.crc);
-            writeLong(out, currentEntry.size);
-            writeLong(out, currentEntry.size);
-        } else {
-            writeLong(out, 0);
-            writeLong(out, 0);
-            writeLong(out, 0);
-        }
-        writeShort(out, nameLength);
-        if (currentEntry.extra != null) {
-            writeShort(out, currentEntry.extra.length);
-        } else {
-            writeShort(out, 0);
-        }
-        nameBytes = toUTF8Bytes(currentEntry.name, nameLength);
-        out.write(nameBytes);
-        if (currentEntry.extra != null) {
-            out.write(currentEntry.extra);
-        }
-    }
-
-    /**
-     * Sets the {@code ZipFile} comment associated with the file being written.
-     *
-     * @param comment
-     *            the comment associated with the file.
-     */
-    public void setComment(String comment) {
-        if (comment.length() > 0xFFFF) {
-            throw new IllegalArgumentException(Messages.getString("archive.2B")); //$NON-NLS-1$
-        }
-        this.comment = comment;
-    }
-
-    /**
-     * Sets the compression level to be used for writing entry data. This level
-     * may be set on a per entry basis. The level must have a value between -1
-     * and 8 according to the {@code Deflater} compression level bounds.
-     *
-     * @param level
-     *            the compression level (ranging from -1 to 8).
-     * @see Deflater
-     */
-    public void setLevel(int level) {
-        if (level < Deflater.DEFAULT_COMPRESSION
-                || level > Deflater.BEST_COMPRESSION) {
-            throw new IllegalArgumentException();
-        }
-        compressLevel = level;
-    }
-
-    /**
-     * Sets the compression method to be used when compressing entry data.
-     * method must be one of {@code STORED} (for no compression) or {@code
-     * DEFLATED}.
-     *
-     * @param method
-     *            the compression method to use.
-     */
-    public void setMethod(int method) {
-        if (method != STORED && method != DEFLATED) {
-            throw new IllegalArgumentException();
-        }
-        compressMethod = method;
-
-    }
-
-    private long writeLong(OutputStream os, long i) throws java.io.IOException {
-        // Write out the long value as an unsigned int
-        os.write((int) (i & 0xFF));
-        os.write((int) (i >> 8) & 0xFF);
-        os.write((int) (i >> 16) & 0xFF);
-        os.write((int) (i >> 24) & 0xFF);
-        return i;
-    }
-
-    private int writeShort(OutputStream os, int i) throws java.io.IOException {
-        os.write(i & 0xFF);
-        os.write((i >> 8) & 0xFF);
-        return i;
-
-    }
-
-    /**
-     * Writes data for the current entry to the underlying stream.
-     *
-     * @exception IOException
-     *                If an error occurs writing to the stream
-     */
-    @Override
-    public void write(byte[] buffer, int off, int nbytes)
-            throws java.io.IOException {
-        // avoid int overflow, check null buf
-        if ((off < 0 || (nbytes < 0) || off > buffer.length)
-                || (buffer.length - off < nbytes)) {
-            throw new IndexOutOfBoundsException();
-        }
-
-        if (currentEntry == null) {
-            /* [MSG "archive.2C", "No active entry"] */
-            throw new ZipException(Messages.getString("archive.2C")); //$NON-NLS-1$
-        }
-
-        if (currentEntry.getMethod() == STORED) {
-            out.write(buffer, off, nbytes);
-        } else {
-            super.write(buffer, off, nbytes);
-        }
-        crc.update(buffer, off, nbytes);
-    }
-
-    static int utf8Count(String value) {
-        int total = 0;
-        for (int i = value.length(); --i >= 0;) {
-            char ch = value.charAt(i);
-            if (ch < 0x80) {
-                total++;
-            } else if (ch < 0x800) {
-                total += 2;
-            } else {
-                total += 3;
-            }
-        }
-        return total;
-    }
-
-    static byte[] toUTF8Bytes(String value, int length) {
-        byte[] result = new byte[length];
-        int pos = result.length;
-        for (int i = value.length(); --i >= 0;) {
-            char ch = value.charAt(i);
-            if (ch < 0x80) {
-                result[--pos] = (byte) ch;
-            } else if (ch < 0x800) {
-                result[--pos] = (byte) (0x80 | (ch & 0x3f));
-                result[--pos] = (byte) (0xc0 | (ch >> 6));
-            } else {
-                result[--pos] = (byte) (0x80 | (ch & 0x3f));
-                result[--pos] = (byte) (0x80 | ((ch >> 6) & 0x3f));
-                result[--pos] = (byte) (0xe0 | (ch >> 12));
-            }
-        }
-        return result;
-    }
-}
diff --git a/libcore/archive/src/main/java/java/util/zip/package.html b/libcore/archive/src/main/java/java/util/zip/package.html
deleted file mode 100644
index 2a09bf1..0000000
--- a/libcore/archive/src/main/java/java/util/zip/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-  <body>
-    <p>
-      This package contains classes for compressing and decompressing data in 
-      ZIP and GZIP file formats.
-    </p>
-    @since Android 1.0
-  </body>
-</html>
diff --git a/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/Messages.java b/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/Messages.java
deleted file mode 100644
index f4f32e1..0000000
--- a/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/Messages.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * THE FILE HAS BEEN AUTOGENERATED BY MSGTOOL TOOL.
- * All changes made to this file manually will be overwritten
- * if this tool runs again. Better make changes in the template file.
- */
-
-// BEGIN android-note
-// Redundant code has been removed and is now called from MsgHelp.
-// END android-note
-
-package org.apache.harmony.archive.internal.nls;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-// BEGIN android-changed
-import org.apache.harmony.luni.util.MsgHelp;
-// END android-changed
-
-/**
- * This class retrieves strings from a resource bundle and returns them,
- * formatting them with MessageFormat when required.
- * <p>
- * It is used by the system classes to provide national language support, by
- * looking up messages in the <code>
- *    org.apache.harmony.archive.internal.nls.messages
- * </code>
- * resource bundle. Note that if this file is not available, or an invalid key
- * is looked up, or resource bundle support is not available, the key itself
- * will be returned as the associated message. This means that the <em>KEY</em>
- * should a reasonable human-readable (english) string.
- *
- */
-public class Messages {
-
-    // BEGIN android-changed
-    private static final String sResource =
-        "org.apache.harmony.archive.internal.nls.messages";
-    // END android-changed
-
-    /**
-     * Retrieves a message which has no arguments.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg) {
-        // BEGIN android-changed
-        return MsgHelp.getString(sResource, msg);
-        // END android-changed
-    }
-
-    /**
-     * Retrieves a message which takes 1 argument.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            Object the object to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object arg) {
-        return getString(msg, new Object[] { arg });
-    }
-
-    /**
-     * Retrieves a message which takes 1 integer argument.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            int the integer to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, int arg) {
-        return getString(msg, new Object[] { Integer.toString(arg) });
-    }
-
-    /**
-     * Retrieves a message which takes 1 character argument.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @param arg
-     *            char the character to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, char arg) {
-        return getString(msg, new Object[] { String.valueOf(arg) });
-    }
-
-    /**
-     * Retrieves a message which takes 2 arguments.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @param arg1
-     *            Object an object to insert in the formatted output.
-     * @param arg2
-     *            Object another object to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object arg1, Object arg2) {
-        return getString(msg, new Object[] { arg1, arg2 });
-    }
-
-    /**
-     * Retrieves a message which takes several arguments.
-     *
-     * @param msg
-     *            String the key to look up.
-     * @param args
-     *            Object[] the objects to insert in the formatted output.
-     * @return String the message for that key in the system message bundle.
-     */
-    static public String getString(String msg, Object[] args) {
-        // BEGIN android-changed
-        return MsgHelp.getString(sResource, msg, args);
-        // END android-changed
-    }
-
-    // BEGIN android-note
-    // Duplicate code was dropped in favor of using MsgHelp.
-    // END android-note
-}
diff --git a/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties b/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties
deleted file mode 100644
index 631101f..0000000
--- a/libcore/archive/src/main/java/org/apache/harmony/archive/internal/nls/messages.properties
+++ /dev/null
@@ -1,71 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#  
-#      http://www.apache.org/licenses/LICENSE-2.0
-#  
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-# 
-
-# messages for EN locale
-archive.00=Canonical encodings have been incorrectly modified
-archive.01=Encoding cannot be less than zero
-archive.02=End of buffer read whilst trying to decode codec
-archive.03=End of buffer read whilst trying to decode codec
-archive.04=ADef and BDef should never both be true
-archive.05=Invalid codec encoding byte ({0}) found 
-archive.06=Something has gone wrong during parsing references
-archive.07=Bad header
-archive.08=Invalid segment major version
-archive.09=Invalid segment minor version
-archive.0A=There are attribute flags, and I don't know what to do with them
-archive.0B=Not yet implemented
-archive.0C=No idea what the adc is for yet
-archive.0D=Failed to read some data from input stream
-archive.0E=Failed to read any data from input stream
-archive.0F=L must be between 1..255
-archive.10=Population encoding does not work unless the number of elements are known
-archive.11=Cannot calculate token codec from {0} and {1}
-archive.12=Cannot have a RunCodec for a negative number of numbers
-archive.13=Must supply both codecs for a RunCodec
-archive.14=Some unused flags are non-zero
-archive.15=1<=b<=5
-archive.16=1<=h<=256
-archive.17=0<=s<=2
-archive.18=0<=d<=1
-archive.19=b=1 -> h=256
-archive.1A=h=256 -> b\!=5
-archive.1B=Delta encoding used without passing in last value; this is a coding error
-archive.1C=End of stream reached whilst decoding
-archive.1D=Unknown s value
-archive.1E=Stream is closed
-archive.1F=Unknown format
-archive.20=Crc mismatch
-archive.21=Size mismatch
-archive.22=Cannot read version
-archive.23=Entry is not named
-archive.24=Unable to open\: {0}
-archive.25=Invalid zip file\: {0}
-archive.26=attempt to write after finish
-archive.27=Needs dictionary
-archive.28=No entries
-archive.29=Entry already exists: {0}
-archive.2A=Name too long: {0}
-archive.2B=String is too long
-archive.2C=No active entry
-archive.2D=Missing version attribute\: {0}
-archive.2E=Manifest is too long
-archive.2F=NUL character in a manifest
-archive.30=Invalid attribute {0}
-archive.31={0} failed verification of {1}
-archive.32={0} has invalid digest for {1} in {2}
-archive.33=A length of the encoded header name "{1}" exceeded maximum length {2}
-archive.34=A jar verifier does not support more than one entry with the same name
-archive.35=JarFile has been closed
diff --git a/libcore/archive/src/main/java/org/apache/harmony/archive/util/Util.java b/libcore/archive/src/main/java/org/apache/harmony/archive/util/Util.java
deleted file mode 100644
index 2ac4e90..0000000
--- a/libcore/archive/src/main/java/org/apache/harmony/archive/util/Util.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.util;
-
-/**
- * Helpers for the archive module.
- */
-public class Util {
-
-    /**
-     * Returns whether the given source string ends with the suffix, ignoring
-     * case and assuming that the strings are ascii encoded.
-     * 
-     * @param source
-     *            the string to match.
-     * @param suffix
-     *            the suffix to test.
-     * @return {@code true} if the source does end with the given suffix, or
-     *         {@code false} if not.
-     */
-    public static boolean asciiEndsWithIgnoreCase(String source, String suffix) {
-        int length = suffix.length();
-        if (length > source.length()) {
-            return false;
-        }
-        int offset = source.length() - length;
-        for (int i = 0; i < length; i++) {
-            char c1 = source.charAt(i + offset);
-            char c2 = suffix.charAt(i);
-            if (c1 != c2 && toASCIIUpperCase(c1) != toASCIIUpperCase(c2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares the given byte arrays and returns whether they are equal,
-     * ignoring case differences and assuming they are ascii-encoded strings.
-     * 
-     * @param buf1
-     *            first byte array to compare.
-     * @param buf2
-     *            second byte array to compare.
-     * @return the result of the comparison.
-     */
-    public static boolean asciiEqualsIgnoreCase(byte[] buf1, byte[] buf2) {
-        if (buf1 == null || buf2 == null) {
-            return false;
-        }
-        if (buf1 == buf2) {
-            return true;
-        }
-        if (buf1.length != buf2.length) {
-            return false;
-        }
-
-        for (int i = 0; i < buf1.length; i++) {
-            byte b1 = buf1[i];
-            byte b2 = buf2[i];
-            if (b1 != b2 && toASCIIUpperCase(b1) != toASCIIUpperCase(b2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares the given strings and returns whether they are equal, ignoring
-     * case differences and assuming they are ascii-encoded strings.
-     * 
-     * @param s1
-     *            first string to compare.
-     * @param s2
-     *            second string to compare.
-     * @return the result of the comparison.
-     */
-    public static boolean asciiEqualsIgnoreCase(String s1, String s2) {
-        if (s1 == null || s2 == null) {
-            return false;
-        }
-        if (s1 == s2) {
-            return true;
-        }
-
-        int length = s1.length();
-        if (length != s2.length()) {
-            return false;
-        }
-
-        for (int i = 0; i < length; i++) {
-            char c1 = s1.charAt(i);
-            char c2 = s2.charAt(i);
-            if (c1 != c2 && toASCIIUpperCase(c1) != toASCIIUpperCase(c2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    private static final byte toASCIIUpperCase(byte b) {
-        if ('a' <= b && b <= 'z') {
-            return (byte) (b - ('a' - 'A'));
-        }
-        return b;
-    }
-
-    private static final char toASCIIUpperCase(char c) {
-        if ('a' <= c && c <= 'z') {
-            return (char) (c - ('a' - 'A'));
-        }
-        return c;
-    }
-}
diff --git a/libcore/archive/src/main/native/hy2sie.h b/libcore/archive/src/main/native/hy2sie.h
deleted file mode 100644
index d40d0e8..0000000
--- a/libcore/archive/src/main/native/hy2sie.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#if !defined(hy2sie_h)
-#define hy2sie_h
-
-
-#include "JNIHelp.h"
-#include "jni.h"
-#include "sieb.h"
-
-
-typedef int BOOLEAN;
-#define TRUE 1
-#define FALSE 0
-
-
-// mc: Stuff adopted from hyport.h:
-
-/** HyMaxPath was chosen from unix MAXPATHLEN.  Override in platform
-  * specific hyfile implementations if needed.
-  */
-#define HyMaxPath   1024
-
-
-
-// Following definitions from hycomp.h:
-
-/**
- * Define common types:
- * <ul>
- * <li><code>U_32 / I_32</code>  - unsigned/signed 32 bits</li>
- * <li><code>U_16 / I_16</code>  - unsigned/signed 16 bits</li>
- * <li><code>U_8 / I_8</code>    - unsigned/signed 8 bits (bytes -- not to be
- *                                 confused with char)</li>
- * </ul>
- */
-
-typedef int I_32;
-typedef short I_16;
-typedef signed char I_8; /* chars can be unsigned */
-typedef unsigned int U_32;
-typedef unsigned short U_16;
-typedef unsigned char U_8;
-
-typedef long long I_64;
-typedef unsigned long long U_64;
-
-/**
- * Define platform specific types:
- * <ul>
- * <li><code>UDATA</code>        - unsigned data, can be used as an integer or
- *                                 pointer storage</li>
- * <li><code>IDATA</code>        - signed data, can be used as an integer or
- *                                 pointer storage</li>
- * </ul>
- */
-/* FIXME: POINTER64 */
-
-typedef I_32 IDATA;
-typedef U_32 UDATA;
-
-
-// Further required definitions from Harmony:
-
-#define HYCONST64(x) x##L
-
-
-#define HY_CFUNC
-#define HY_CDATA
-#define PROTOTYPE(x) x
-#define VMCALL
-#define PVMCALL *
-#define NORETURN
-
-#define GLOBAL_DATA(symbol) ((void*)&(symbol))
-
-
-// Following definitions substitute the HyPortLibrary simply with the JNIEnv
-
-typedef JNIEnv HyPortLibrary;
-
-#define PORT_ACCESS_FROM_ENV(env) HyPortLibrary *privatePortLibrary = env
-#define PORT_ACCESS_FROM_PORT(portLibrary) HyPortLibrary *privatePortLibrary = portLibrary
-#define PORTLIB privatePortLibrary
-
-
-// Following defintion is used to avoide quite a few signedness warnings:
-#define mcSignednessBull void *
-
-
-// Following the substitution of hyfile:
-
-#include <fcntl.h>
-
-#define HyOpenRead    O_RDONLY
-#define hyfile_open(a, b, c) open(a, b, c)
-
-#define HySeekEnd SEEK_END
-#define HySeekSet SEEK_SET
-#define HySeekCur SEEK_CUR
-#define hyfile_seek(a, b, c) lseek(a, b, c)
-
-#define hyfile_read(a, b, c) read(a, b, c)
-
-#define hyfile_close(a) close(a)
-
-
-// And further substitutions:
-
-#define hymem_allocate_memory(byteCount) sieb_malloc(privatePortLibrary, byteCount)
-#define hymem_free_memory(pointer) sieb_free(privatePortLibrary, pointer)
-
-#define ioh_convertToPlatform(path) sieb_convertToPlatform (path)
-
-
-#endif /* hy2sie_h */
diff --git a/libcore/archive/src/main/native/hycomp.h b/libcore/archive/src/main/native/hycomp.h
deleted file mode 100644
index 029d4fe..0000000
--- a/libcore/archive/src/main/native/hycomp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "hy2sie.h"
diff --git a/libcore/archive/src/main/native/hymutex.h b/libcore/archive/src/main/native/hymutex.h
deleted file mode 100644
index 5c98ebd..0000000
--- a/libcore/archive/src/main/native/hymutex.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#if !defined(hymutex_h)
-#define hymutex_h
-
-#include <pthread.h>
-#include <stdlib.h>
-
-typedef pthread_mutex_t MUTEX;
-
-/* MUTEX_INIT */
-#define MUTEX_INIT(mutex) (pthread_mutex_init(&(mutex), NULL) == 0)
-
-/* MUTEX_DESTROY */
-#define MUTEX_DESTROY(mutex) pthread_mutex_destroy(&(mutex))
-
-/* MUTEX_ENTER */
-#define MUTEX_ENTER(mutex) pthread_mutex_lock(&(mutex))
-
-/*
- *  MUTEX_TRY_ENTER 
- *  returns 0 on success
- */
-#define MUTEX_TRY_ENTER(mutex) pthread_mutex_trylock(&(mutex))
-
-/* MUTEX_EXIT */
-#define MUTEX_EXIT(mutex) pthread_mutex_unlock(&(mutex))
-
-#endif     /* hymutex_h */
diff --git a/libcore/archive/src/main/native/hyport.h b/libcore/archive/src/main/native/hyport.h
deleted file mode 100644
index 029d4fe..0000000
--- a/libcore/archive/src/main/native/hyport.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "hy2sie.h"
diff --git a/libcore/archive/src/main/native/java_util_zip_Adler32.c b/libcore/archive/src/main/native/java_util_zip_Adler32.c
deleted file mode 100644
index 0fcf549..0000000
--- a/libcore/archive/src/main/native/java_util_zip_Adler32.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "jni.h"
-#include "hy2sie.h"
-#include "zlib.h"
-#include "sieb.h"
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Adler32_updateImpl (JNIEnv * env, jobject recv,
-                                       jbyteArray buf, int off, int len,
-                                       jlong crc)
-{
-  jbyte* b = (*env)->GetPrimitiveArrayCritical (env, buf, NULL);
-  if (b == NULL) {
-    return 0;
-  }
-  jlong result = (jlong) adler32 ((uLong) crc, (Bytef *) (b + off), (uInt) len);
-  (*env)->ReleasePrimitiveArrayCritical (env, buf, b, JNI_ABORT);
-
-  return result;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Adler32_updateByteImpl (JNIEnv * env, jobject recv,
-                                           jint val, jlong crc)
-{
-  Bytef bytefVal = val;
-  return adler32 ((uLong) crc, (Bytef *) (&bytefVal), 1);
-}
-
-
-/*
- * JNI registration
- */
-static JNINativeMethod gMethods[] = {
-    /* name, signature, funcPtr */
-    { "updateImpl", "([BIIJ)J",     Java_java_util_zip_Adler32_updateImpl },
-    { "updateByteImpl", "(IJ)J",     Java_java_util_zip_Adler32_updateByteImpl },
-};
-int register_java_util_zip_Adler32(JNIEnv* env)
-{
-    return jniRegisterNativeMethods(env, "java/util/zip/Adler32",
-                gMethods, NELEM(gMethods));
-}
diff --git a/libcore/archive/src/main/native/java_util_zip_CRC32.c b/libcore/archive/src/main/native/java_util_zip_CRC32.c
deleted file mode 100644
index fe50fca..0000000
--- a/libcore/archive/src/main/native/java_util_zip_CRC32.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hy2sie.h"
-#include "sieb.h"
-
-#include "zlib.h"
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_CRC32_updateImpl (JNIEnv * env, jobject recv,
-                                     jbyteArray buf, int off, int len,
-                                     jlong crc)
-{
-  jbyte* b = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (b == NULL) {
-    return -1;
-  }
-  jlong result = crc32 ((uLong) crc, (Bytef *) (b + off), (uInt) len);
-  ((*env)->ReleasePrimitiveArrayCritical (env, buf, b, JNI_ABORT));
-  return result;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_CRC32_updateByteImpl (JNIEnv * env, jobject recv,
-                                         jbyte val, jlong crc)
-{
-  return crc32 ((uLong) crc, (Bytef *) (&val), 1);
-}
-
-
-/*
- * JNI registration
- */
-static JNINativeMethod gMethods[] = {
-    /* name, signature, funcPtr */
-    { "updateImpl", "([BIIJ)J",     Java_java_util_zip_CRC32_updateImpl },
-    { "updateByteImpl", "(BJ)J",     Java_java_util_zip_CRC32_updateByteImpl },
-};
-int register_java_util_zip_CRC32(JNIEnv* env)
-{
-    return jniRegisterNativeMethods(env, "java/util/zip/CRC32",
-                gMethods, NELEM(gMethods));
-}
diff --git a/libcore/archive/src/main/native/java_util_zip_Deflater.c b/libcore/archive/src/main/native/java_util_zip_Deflater.c
deleted file mode 100644
index af0bfcc..0000000
--- a/libcore/archive/src/main/native/java_util_zip_Deflater.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hy2sie.h"
-
-#include "zlib.h"
-#include "zip.h"
-#include "jni.h"
-
-#ifndef HY_ZIP_API
-void zfree PROTOTYPE ((void *opaque, void *address));
-void *zalloc PROTOTYPE ((void *opaque, U_32 items, U_32 size));
-#endif
-
-
-static struct {
-    jfieldID inRead;
-    jfieldID finished;
-} gCachedFields;
-
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_setDictionaryImpl (JNIEnv * env, jobject recv,
-					       jbyteArray dict, int off,
-					       int len, jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-  int err = 0;
-  unsigned char *dBytes;
-  JCLZipStream *stream = (JCLZipStream *) ((IDATA) handle);
-
-  dBytes = jclmem_allocate_memory (env, len);
-  if (dBytes == NULL)
-    {
-      throwNewOutOfMemoryError (env, "");
-      return;
-    }
-  (*env)->GetByteArrayRegion (env, dict, off, len, (mcSignednessBull)dBytes);
-  err = deflateSetDictionary (stream->stream, (Bytef *) dBytes, len);
-  if (err != Z_OK)
-    {
-      jclmem_free_memory (env, dBytes);
-      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
-      return;
-    }
-  stream->dict = (U_8*) dBytes;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Deflater_getTotalInImpl (JNIEnv * env, jobject recv,
-					    jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  return stream->stream->total_in;
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Deflater_getTotalOutImpl (JNIEnv * env, jobject recv,
-					     jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  return stream->stream->total_out;
-}
-
-JNIEXPORT jint JNICALL
-Java_java_util_zip_Deflater_getAdlerImpl (JNIEnv * env, jobject recv,
-					  jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-
-  return stream->stream->adler;
-}
-
-/* Create a new stream . This stream cannot be used until it has been properly initialized. */
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Deflater_createStream (JNIEnv * env, jobject recv,
-					  jint level, jint strategy,
-					  jboolean noHeader)
-{
-  PORT_ACCESS_FROM_ENV (env);
-  JCLZipStream *jstream;
-  z_stream *stream;
-  int err = 0;
-  // BEGIN android-changed
-  int wbits = 12; // Was 15, made it 12 to reduce memory consumption. Use MAX
-                  // for fastest.
-  int mlevel = 5; // Was 9, made it 5 to reduce memory consumption. Might result
-                  // in out-of-memory problems according to some web pages. The
-                  // ZLIB docs are a bit vague, unfortunately. The default
-                  // results in 2 x 128K being allocated per Deflater, which is
-                  // not acceptable.
-  // END android-changed
-#ifdef HY_ZIP_API
-  VMI_ACCESS_FROM_ENV (env);
-  VMIZipFunctionTable *zipFuncs;
-  zipFuncs = (*VMI)->GetZipFunctions(VMI);
-#endif
-
-  /*Allocate mem for wrapped struct */
-  jstream = jclmem_allocate_memory (env, sizeof (JCLZipStream));
-  if (jstream == NULL)
-    {
-      throwNewOutOfMemoryError (env, "");
-      return -1;
-    }
-  /*Allocate the z_stream */
-  stream = jclmem_allocate_memory (env, sizeof (z_stream));
-  if (stream == NULL)
-    {
-      jclmem_free_memory (env, jstream);
-      throwNewOutOfMemoryError (env, "");
-      return -1;
-    }
-  stream->opaque = (void *) privatePortLibrary;
-  stream->zalloc = zalloc;
-  stream->zfree = zfree;
-  jstream->stream = stream;
-  jstream->dict = NULL;
-  jstream->inaddr = NULL;
-
-  /*Unable to find official doc that this is the way to avoid zlib header use. However doc in zipsup.c claims it is so */
-  if (noHeader)
-    wbits = wbits / -1;
-  err = deflateInit2 (stream, level, Z_DEFLATED,	/*Only supported ZLIB method */
-		      wbits,	/*Window bits to use. 15 is fastest but consumes the most memory */
-		      // BEGIN android-changed
-		      mlevel,	/*Memory allocation for internal compression state. 9 uses the most. */
-		      // END android-changed
-		      strategy);
-  if (err != Z_OK) {
-    THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
-    return -1;
-  }
-
-  return (jlong) ((IDATA) jstream);
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_setInputImpl (JNIEnv * env, jobject recv,
-					  jbyteArray buf, jint off, jint len,
-					  jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-
-  JCLZipStream* stream = (JCLZipStream *) ((IDATA) handle);
-  if (stream->inaddr != NULL) {
-    /* Input has already been provided, free the old buffer. */
-    jclmem_free_memory (env, stream->inaddr);
-  }
-  stream->inaddr = jclmem_allocate_memory (env, len);
-  if (stream->inaddr == NULL) {
-    throwNewOutOfMemoryError (env, "");
-    return;
-  }
-  (*env)->GetByteArrayRegion(env, buf, off, len, (jbyte*) stream->inaddr);
-  stream->stream->next_in = (Bytef *) stream->inaddr;
-  stream->stream->avail_in = len;
-}
-
-JNIEXPORT jint JNICALL
-Java_java_util_zip_Deflater_deflateImpl (JNIEnv * env, jobject recv,
-					 jbyteArray buf, int off, int len,
-					 jlong handle, int flushParm)
-{
-  jbyte *out;
-  JCLZipStream *stream;
-  jint err = 0;
-  jint sin, sout, inBytes = 0;
-
-  /* We need to get the number of bytes already read */
-  inBytes =
-    ((*env)->
-     GetIntField (env, recv,
-		  gCachedFields.inRead));
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  stream->stream->avail_out = len;
-  sin = stream->stream->total_in;
-  sout = stream->stream->total_out;
-  out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (out == NULL) {
-    return -1;
-  }
-  stream->stream->next_out = (Bytef *) out + off;
-  err = deflate (stream->stream, flushParm);
-  ((*env)->ReleasePrimitiveArrayCritical (env, buf, out, 0));
-  if (err != Z_OK) {
-    if (err == Z_MEM_ERROR) {
-      throwNewOutOfMemoryError(env, "");
-      return 0;
-    }
-    if (err == Z_STREAM_END)
-      {
-        ((*env)->
-         SetBooleanField (env, recv,
-                          gCachedFields.finished,
-                          JNI_TRUE));
-        return stream->stream->total_out - sout;
-      }
-  }
-  if (flushParm != Z_FINISH)
-    {
-      /* Need to update the number of input bytes read. */
-      ((*env)->
-       SetIntField (env, recv,
-                    gCachedFields.inRead,
-                    (jint) stream->stream->total_in - sin + inBytes));
-    }
-  return stream->stream->total_out - sout;
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_endImpl (JNIEnv * env, jobject recv, jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-
-  deflateEnd (stream->stream);
-  if (stream->inaddr != NULL)
-    jclmem_free_memory (env, stream->inaddr);
-  if (stream->dict != NULL)
-    jclmem_free_memory (env, stream->dict);
-  jclmem_free_memory (env, stream->stream);
-  jclmem_free_memory (env, stream);
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_resetImpl (JNIEnv * env, jobject recv,
-				       jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  deflateReset (stream->stream);
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_setLevelsImpl (JNIEnv * env, jobject recv,
-					   int level, int strategy,
-					   jlong handle)
-{
-  JCLZipStream *stream;
-  jbyte b = 0;
-  int err = 0;
-
-  if (handle == -1)
-    {
-      throwNewIllegalStateException (env, "");
-      return;
-    }
-  stream = (JCLZipStream *) ((IDATA) handle);
-  stream->stream->next_out = (Bytef *) & b;
-  err = deflateParams (stream->stream, level, strategy);
-  if (err != Z_OK) {
-    THROW_ZIP_EXCEPTION(env, err, IllegalStateException);
-  }
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Deflater_oneTimeInitialization (JNIEnv * env, jclass clazz)
-{
-    memset(&gCachedFields, 0, sizeof(gCachedFields));
-    gCachedFields.inRead = (*env)->GetFieldID (env, clazz, "inRead", "I");
-    gCachedFields.finished = (*env)->GetFieldID (env, clazz, "finished", "Z");
-}
-
-/*
- * JNI registration
- */
-static JNINativeMethod gMethods[] = {
-    /* name, signature, funcPtr */
-    { "setDictionaryImpl", "([BIIJ)V",     Java_java_util_zip_Deflater_setDictionaryImpl },
-    { "getTotalInImpl", "(J)J",     Java_java_util_zip_Deflater_getTotalInImpl },
-    { "getTotalOutImpl", "(J)J",     Java_java_util_zip_Deflater_getTotalOutImpl },
-    { "getAdlerImpl", "(J)I",     Java_java_util_zip_Deflater_getAdlerImpl },
-    { "createStream", "(IIZ)J",     Java_java_util_zip_Deflater_createStream },
-    { "setInputImpl", "([BIIJ)V",     Java_java_util_zip_Deflater_setInputImpl },
-    { "deflateImpl", "([BIIJI)I",     Java_java_util_zip_Deflater_deflateImpl },
-    { "endImpl", "(J)V",     Java_java_util_zip_Deflater_endImpl },
-    { "resetImpl", "(J)V",     Java_java_util_zip_Deflater_resetImpl },
-    { "setLevelsImpl", "(IIJ)V",     Java_java_util_zip_Deflater_setLevelsImpl },
-    { "oneTimeInitialization", "()V",     Java_java_util_zip_Deflater_oneTimeInitialization },
-};
-int register_java_util_zip_Deflater(JNIEnv* env)
-{
-    return jniRegisterNativeMethods(env, "java/util/zip/Deflater",
-                gMethods, NELEM(gMethods));
-}
diff --git a/libcore/archive/src/main/native/java_util_zip_Inflater.c b/libcore/archive/src/main/native/java_util_zip_Inflater.c
deleted file mode 100644
index ba89ce8..0000000
--- a/libcore/archive/src/main/native/java_util_zip_Inflater.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hy2sie.h"
-#include "zip.h"
-
-#include "zlib.h"
-#include <memory.h>
-#define jclmem_allocate_memory(env, byteCount) sieb_malloc(env, byteCount)
-#define jclmem_free_memory(env, pointer) sieb_free(env, pointer)
-
-#include <fcntl.h>
-
-void throwNewDataFormatException (JNIEnv * env, const char *message);
-
-void zfree PROTOTYPE ((void *opaque, void *address));
-void *zalloc PROTOTYPE ((void *opaque, U_32 items, U_32 size));
-
-
-static struct {
-    jfieldID inRead;
-    jfieldID finished;
-    jfieldID needsDictionary;
-} gCachedFields;
-
-
-
-/* Create a new stream . This stream cannot be used until it has been properly initialized. */
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Inflater_createStream (JNIEnv * env, jobject recv,
-                                          jboolean noHeader)
-{
-  PORT_ACCESS_FROM_ENV (env);
-
-  JCLZipStream *jstream;
-  z_stream *stream;
-  int err = 0;
-  int wbits = 15;               /*Use MAX for fastest */
-#ifdef HY_ZIP_API
-  VMI_ACCESS_FROM_ENV (env);
-  VMIZipFunctionTable *zipFuncs;
-  zipFuncs = (*VMI)->GetZipFunctions(VMI);
-#endif
-
-  /*Allocate mem for wrapped struct */
-  jstream = jclmem_allocate_memory (env, sizeof (JCLZipStream));
-  if (jstream == NULL)
-    {
-      throwNewOutOfMemoryError (env, "");
-      return -1;
-    }
-
-  /*Allocate the z_stream */
-  stream = jclmem_allocate_memory (env, sizeof (z_stream));
-  if (stream == NULL)
-    {
-      jclmem_free_memory (env, jstream);
-      throwNewOutOfMemoryError (env, "");
-      return -1;
-    }
-  stream->opaque = (void *) privatePortLibrary;
-  stream->zalloc = zalloc;
-  stream->zfree = zfree;
-  stream->adler = 1;
-  jstream->stream = stream;
-  jstream->dict = NULL;
-  jstream->inaddr = NULL;
-  jstream->inCap = 0;
-
-  /*
-   * In the range 8..15 for checked, or -8..-15 for unchecked inflate. Unchecked
-   * is appropriate for formats like zip that do their own validity checking.
-   */
-  if (noHeader)
-    wbits = wbits / -1;
-  err = inflateInit2 (stream, wbits);   /*Window bits to use. 15 is fastest but consumes the most memory */
-
-  if (err != Z_OK)
-    {
-      jclmem_free_memory (env, stream);
-      jclmem_free_memory (env, jstream);
-      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
-      return -1;
-    }
-
-  return (jlong) ((IDATA) jstream);
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Inflater_setInputImpl (JNIEnv * env, jobject recv,
-                                          jbyteArray buf, jint off, jint len,
-                                          jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-
-  JCLZipStream *stream = (JCLZipStream *) ((IDATA) handle);
-  if (stream->inaddr != NULL) {
-    /* Input has already been provided, free the old buffer. */
-    jclmem_free_memory (env, stream->inaddr);
-  }
-  U_8* baseAddr = jclmem_allocate_memory (env, len);
-  if (baseAddr == NULL) {
-    throwNewOutOfMemoryError (env, "");
-    return;
-  }
-  stream->inaddr = baseAddr;
-  stream->stream->next_in = (Bytef *) baseAddr;
-  stream->stream->avail_in = len;
-  (*env)->GetByteArrayRegion(env, buf, off, len, (jbyte*) baseAddr);
-}
-
-JNIEXPORT jint JNICALL
-Java_java_util_zip_Inflater_setFileInputImpl (JNIEnv * env, jobject recv,
-        jobject javaFileDescriptor, jlong off, jint len, jlong handle)
-{
-    PORT_ACCESS_FROM_ENV (env);
-
-    U_8 * baseAddr;
-    JCLZipStream * stream = (JCLZipStream *) ((IDATA) handle);
-
-    if (stream->inCap < len) {
-        // No input buffer as yet (or one that is too small).
-        jclmem_free_memory(env, stream->inaddr);
-        baseAddr = jclmem_allocate_memory(env, len);
-        if (baseAddr == NULL)
-        {
-            throwNewOutOfMemoryError(env, "");
-            return -1;
-        }
-        stream->inaddr = baseAddr;
-    }
-    stream->stream->next_in = (Bytef *) stream->inaddr;
-    stream->stream->avail_in = len;
-
-    int fd = jniGetFDFromFileDescriptor(env, javaFileDescriptor);
-    lseek(fd, off, SEEK_SET);
-    int cnt = read(fd, stream->inaddr, len);
-
-    return cnt;
-}
-
-JNIEXPORT jint JNICALL
-Java_java_util_zip_Inflater_inflateImpl (JNIEnv * env, jobject recv,
-                                         jbyteArray buf, int off, int len,
-                                         jlong handle)
-{
-  jbyte *out;
-  JCLZipStream *stream = (JCLZipStream *) ((IDATA) handle);
-  jint err = 0;
-  jfieldID fid = 0, fid2 = 0;
-  jint sin, sout, inBytes = 0;
-
-  /* We need to get the number of bytes already read */
-  fid = gCachedFields.inRead;
-  inBytes = ((*env)->GetIntField (env, recv, fid));
-
-  stream->stream->avail_out = len;
-  sin = stream->stream->total_in;
-  sout = stream->stream->total_out;
-  out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0));
-  if (out == NULL) {
-    throwNewOutOfMemoryError(env, "");
-    return -1;
-  }
-  stream->stream->next_out = (Bytef *) out + off;
-  err = inflate (stream->stream, Z_SYNC_FLUSH);
-  ((*env)->ReleasePrimitiveArrayCritical (env, buf, out, 0));
-
-  if (err != Z_OK)
-    {
-      if(err == Z_STREAM_ERROR) {
-          return 0;
-      }
-      if (err == Z_STREAM_END || err == Z_NEED_DICT)
-        {
-          ((*env)->SetIntField (env, recv, fid, (jint) stream->stream->total_in - sin + inBytes));      /* Update inRead */
-          if (err == Z_STREAM_END)
-            fid2 = gCachedFields.finished;
-          else
-            fid2 = gCachedFields.needsDictionary;
-
-          ((*env)->SetBooleanField (env, recv, fid2, JNI_TRUE));
-          return stream->stream->total_out - sout;
-        }
-      else
-        {
-          THROW_ZIP_EXCEPTION(env, err, DataFormatException);
-          return -1;
-        }
-    }
-
-  /* Need to update the number of input bytes read. Is there a better way
-   * (Maybe global the fid then delete when end is called)?
-   */
-  ((*env)->
-   SetIntField (env, recv, fid,
-                (jint) stream->stream->total_in - sin + inBytes));
-
-  return stream->stream->total_out - sout;
-}
-
-JNIEXPORT jint JNICALL
-Java_java_util_zip_Inflater_getAdlerImpl (JNIEnv * env, jobject recv,
-                                          jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-
-  return stream->stream->adler;
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Inflater_endImpl (JNIEnv * env, jobject recv, jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  inflateEnd (stream->stream);
-  if (stream->inaddr != NULL)   /*Input has been provided, free the buffer */
-    jclmem_free_memory (env, stream->inaddr);
-  if (stream->dict != NULL)
-    jclmem_free_memory (env, stream->dict);
-  jclmem_free_memory (env, stream->stream);
-  jclmem_free_memory (env, stream);
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Inflater_setDictionaryImpl (JNIEnv * env, jobject recv,
-                                               jbyteArray dict, int off,
-                                               int len, jlong handle)
-{
-  PORT_ACCESS_FROM_ENV (env);
-  int err = 0;
-  U_8 *dBytes;
-  JCLZipStream *stream = (JCLZipStream *) ((IDATA) handle);
-
-  dBytes = jclmem_allocate_memory (env, len);
-  if (dBytes == NULL)
-    {
-      throwNewOutOfMemoryError (env, "");
-      return;
-    }
-  (*env)->GetByteArrayRegion (env, dict, off, len, (mcSignednessBull)dBytes);
-  err = inflateSetDictionary (stream->stream, (Bytef *) dBytes, len);
-  if (err != Z_OK)
-    {
-      jclmem_free_memory (env, dBytes);
-      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
-      return;
-    }
-  stream->dict = dBytes;
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Inflater_resetImpl (JNIEnv * env, jobject recv,
-                                       jlong handle)
-{
-  JCLZipStream *stream;
-  int err = 0;
-  stream = (JCLZipStream *) ((IDATA) handle);
-
-  err = inflateReset (stream->stream);
-  if (err != Z_OK)
-    {
-      THROW_ZIP_EXCEPTION(env, err, IllegalArgumentException);
-      return;
-    }
-}
-
-/**
-  * Throw java.util.zip.DataFormatException
-  */
-void
-throwNewDataFormatException (JNIEnv * env, const char *message)
-{
-  jniThrowException(env, "java/util/zip/DataFormatException", message);
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Inflater_getTotalOutImpl (JNIEnv * env, jobject recv,
-                                             jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  return stream->stream->total_out;
-
-}
-
-JNIEXPORT jlong JNICALL
-Java_java_util_zip_Inflater_getTotalInImpl (JNIEnv * env, jobject recv,
-                                            jlong handle)
-{
-  JCLZipStream *stream;
-
-  stream = (JCLZipStream *) ((IDATA) handle);
-  return stream->stream->total_in;
-}
-
-JNIEXPORT void JNICALL
-Java_java_util_zip_Inflater_oneTimeInitialization (JNIEnv * env, jclass clazz)
-{
-    memset(&gCachedFields, 0, sizeof(gCachedFields));
-    gCachedFields.inRead = (*env)->GetFieldID (env, clazz, "inRead", "I");
-    gCachedFields.finished = (*env)->GetFieldID (env, clazz, "finished", "Z");
-    gCachedFields.needsDictionary = (*env)->GetFieldID (env, clazz, "needsDictionary", "Z");
-}
-
-/*
- * JNI registration
- */
-static JNINativeMethod gMethods[] = {
-    /* name, signature, funcPtr */
-    { "createStream", "(Z)J",     Java_java_util_zip_Inflater_createStream },
-    { "setInputImpl", "([BIIJ)V",     Java_java_util_zip_Inflater_setInputImpl },
-    { "setFileInputImpl", "(Ljava/io/FileDescriptor;JIJ)I",     Java_java_util_zip_Inflater_setFileInputImpl },
-    { "inflateImpl", "([BIIJ)I",     Java_java_util_zip_Inflater_inflateImpl },
-    { "getAdlerImpl", "(J)I",     Java_java_util_zip_Inflater_getAdlerImpl },
-    { "endImpl", "(J)V",     Java_java_util_zip_Inflater_endImpl },
-    { "setDictionaryImpl", "([BIIJ)V",     Java_java_util_zip_Inflater_setDictionaryImpl },
-    { "resetImpl", "(J)V",     Java_java_util_zip_Inflater_resetImpl },
-    { "getTotalOutImpl", "(J)J",     Java_java_util_zip_Inflater_getTotalOutImpl },
-    { "getTotalInImpl", "(J)J",     Java_java_util_zip_Inflater_getTotalInImpl },
-    { "oneTimeInitialization", "()V",     Java_java_util_zip_Inflater_oneTimeInitialization },
-};
-int register_java_util_zip_Inflater(JNIEnv* env)
-{
-    return jniRegisterNativeMethods(env, "java/util/zip/Inflater",
-                gMethods, NELEM(gMethods));
-}
diff --git a/libcore/archive/src/main/native/sieb.c b/libcore/archive/src/main/native/sieb.c
deleted file mode 100644
index 4529307..0000000
--- a/libcore/archive/src/main/native/sieb.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "sieb.h"
-#include "JNIHelp.h"
-#include "jni.h"
-
-#include <stdlib.h>
-
-// Throw java.lang.OutOfMemoryError
-void throwNewOutOfMemoryError(JNIEnv *env, const char *message) {
-    jniThrowException(env, "java/lang/OutOfMemoryError", message);
-}
-
-void *sieb_malloc(JNIEnv *env, size_t byteCnt) {
-    void *adr = malloc(byteCnt);
-    if (adr == 0) {
-        if (byteCnt == 0) {
-            throwNewOutOfMemoryError(env, "sieb_malloc(0) NOT ALLOWED");
-        } else {
-            throwNewOutOfMemoryError(env, "sieb_malloc");
-        }
-    }
-    return adr;
-}
-
-void sieb_free(JNIEnv *env, void *adr) {
-    free(adr);
-}
-
-void sieb_convertToPlatform(char *path) {
-    char *pathIndex;
-
-    pathIndex = path;
-    while (*pathIndex != '\0') {
-        if (*pathIndex == '\\') {
-            *pathIndex = '/';
-        }
-        pathIndex++;
-    }
-}
diff --git a/libcore/archive/src/main/native/sieb.h b/libcore/archive/src/main/native/sieb.h
deleted file mode 100644
index c32da04..0000000
--- a/libcore/archive/src/main/native/sieb.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#if !defined(sieb_h)
-#define sieb_h
-
-#include "JNIHelp.h"
-#include "jni.h"
-
-void throwNewOutOfMemoryError(JNIEnv *env, const char *message);
-void *sieb_malloc(JNIEnv *env, size_t byteCnt);
-void sieb_free(JNIEnv *env, void *adr);
-void sieb_convertToPlatform(char *path);
-
-#endif /* sieb_h */
diff --git a/libcore/archive/src/main/native/sub.mk b/libcore/archive/src/main/native/sub.mk
deleted file mode 100644
index 694c185..0000000
--- a/libcore/archive/src/main/native/sub.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# This file is included by the top-level libcore Android.mk.
-# It's not a normal makefile, so we don't include CLEAR_VARS
-# or BUILD_*_LIBRARY.
-
-LOCAL_SRC_FILES := \
-	java_util_zip_Adler32.c \
-	java_util_zip_CRC32.c \
-	java_util_zip_Deflater.c \
-	java_util_zip_Inflater.c \
-	zip.c \
-	zipalloc.c \
-	sieb.c
-
-LOCAL_C_INCLUDES += \
-	external/zlib
-
-# Any shared/static libs that are listed here must also
-# be listed in libs/nativehelper/Android.mk.
-# TODO: fix this requirement
-
-LOCAL_SHARED_LIBRARIES += \
-	libz
-
-LOCAL_STATIC_LIBRARIES +=
diff --git a/libcore/archive/src/main/native/zip.c b/libcore/archive/src/main/native/zip.c
deleted file mode 100644
index 3d15d2a..0000000
--- a/libcore/archive/src/main/native/zip.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "zip.h"
-#include "jni.h"
-
-/**
-  * Throw java.lang.IllegalStateException
-  */
-void
-throwNewIllegalStateException (JNIEnv * env, const char *message)
-{
-  jniThrowException(env, "java/lang/IllegalStateException", message);
-}
-
-/**
-  * Throw java.lang.IllegalArgumentException
-  */
-void
-throwNewIllegalArgumentException (JNIEnv * env, const char *message)
-{
-  jniThrowException(env, "java/lang/IllegalArgumentException", message);
-}
diff --git a/libcore/archive/src/main/native/zip.h b/libcore/archive/src/main/native/zip.h
deleted file mode 100644
index 1452073..0000000
--- a/libcore/archive/src/main/native/zip.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#if !defined(zip_h)
-#define zip_h
-
-#ifndef HY_ZIP_API
-#include "zipsup.h"
-#else /* HY_ZIP_API */
-#include "vmizip.h"
-#endif /* HY_ZIP_API */
-
-#include "hymutex.h"
-
-typedef struct JCLZipFile
-{
-  struct JCLZipFile *last;
-  struct JCLZipFile *next;
-#ifndef HY_ZIP_API
-  HyZipFile hyZipFile;
-#else
-  VMIZipFile hyZipFile;
-#endif
-} JCLZipFile;
-
-/* Fake JCLZipFile entry. last, next must be in the same position as JCLZipFile */
-typedef struct JCLZipFileLink
-{
-  JCLZipFile *last;
-  JCLZipFile *next;
-  MUTEX mutex;
-} JCLZipFileLink;
-
-// Contents from Harmony's inflater.h was put here:
-//
-typedef struct JCLZipStream
-{
-  U_8 *inaddr;
-  int inCap;
-  U_8 *dict;
-  z_stream *stream;
-} JCLZipStream;
-
-#define THROW_ZIP_EXCEPTION(env, err, type)            \
-  if (err == Z_MEM_ERROR) {                            \
-    throwNewOutOfMemoryError(env, "");                 \
-  } else {                                             \
-    throwNew##type(env, (const char*) zError(err));    \
-  }
-
-void throwNewIllegalStateException PROTOTYPE((JNIEnv* env,
-                                              const char* message));
-void throwNewIllegalArgumentException PROTOTYPE((JNIEnv* env,
-                                                 const char* message));
-
-#endif /* zip_h */
diff --git a/libcore/archive/src/main/native/zipalloc.c b/libcore/archive/src/main/native/zipalloc.c
deleted file mode 100644
index 2b4966b..0000000
--- a/libcore/archive/src/main/native/zipalloc.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hyport.h"
-
-#include "zlib.h"
-
-#define CDEV_CURRENT_FUNCTION _prototypes_private
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION _prototypes_public
-void *zalloc PROTOTYPE ((void *opaque, U_32 items, U_32 size));
-void zfree PROTOTYPE ((void *opaque, void *address));
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zalloc
-
-/*
-	ZLib interface to hymem_allocate_memory.
-*/
-void *
-zalloc (void *opaque, U_32 items, U_32 size)
-{
-  PORT_ACCESS_FROM_PORT (((HyPortLibrary *) opaque));
-
-  return hymem_allocate_memory (items * size);
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zfree
-
-/*
-	ZLib interface to hymem_free_memory.
-*/
-void
-zfree (void *opaque, void *address)
-{
-  PORT_ACCESS_FROM_PORT ((HyPortLibrary *) opaque);
-
-  hymem_free_memory (address);
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION
-
-#undef CDEV_CURRENT_FUNCTION
diff --git a/libcore/archive/src/main/native/zipsup.c b/libcore/archive/src/main/native/zipsup.c
deleted file mode 100644
index d6d07da..0000000
--- a/libcore/archive/src/main/native/zipsup.c
+++ /dev/null
@@ -1,2319 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @file
- * @ingroup ZipSupport
- * @brief Zip Support for Java VM
-*/
-
-#include <string.h>
-#include <sys/stat.h>
-
-#include "hy2sie.h"
-#include "zipsup.h"
-
-#include "zlib.h"
-
-// zlib is statically linked for Android:
-#define checkZipLibrary(dummy) 0
-#ifdef checkZipLibrary
-#define inflateInit2Func(a, b, c, d) inflateInit2_ (a, b, c, d)
-#define inflateFunc(a, b) inflate (a, b)
-#define inflateEndFunc(a) inflateEnd (a)
-#else
-/* Globals for the zip library */
-UDATA zipDLLDescriptor = 0;
-int (*inflateInit2Func) (void *, int, const char *, int);
-int (*inflateFunc) (void *, int);
-int (*inflateEndFunc) (void *);
-#endif
-
-#define ZIP_NEXT_U8(value, index) (value = *(index++))
-#define ZIP_NEXT_U16(value, index) ((value = (index[1] << 8) | index[0]), index += 2, value)
-#define ZIP_NEXT_U32(value, index) ((value = ((U_32)index[3] << 24) | ((U_32)index[2] << 16) | ((U_32)index[1] << 8) | (U_32)index[0]), index += 4, value)
-
-#define WORK_BUFFER_SIZE 64000
-
-#define SCAN_CHUNK_SIZE 1024
-
-struct workBuffer
-{
-  HyPortLibrary *portLib;
-  UDATA *bufferStart;
-  UDATA *bufferEnd;
-  UDATA *currentAlloc;
-  UDATA cntr;
-};
-
-#define CDEV_CURRENT_FUNCTION _prototypes_private
-I_32 zip_populateCache
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile));
-
-static I_32 inflateData
-PROTOTYPE ((struct workBuffer * workBuf, U_8 * inputBuffer,
-            U_32 inputBufferSize, U_8 * outputBuffer, U_32 outputBufferSize));
-
-I_32 checkZipLibrary PROTOTYPE ((HyPortLibrary * portLib));
-
-I_32 scanForDataDescriptor
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-            HyZipEntry * zipEntry));
-void zdatafree PROTOTYPE ((void *opaque, void *address));
-static I_32 readZipEntry
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-            HyZipEntry * zipEntry, const char *filename,
-            IDATA * enumerationPointer, IDATA * entryStart,
-            BOOLEAN findDirectory));
-I_32 scanForCentralEnd
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-            HyZipCentralEnd * endEntry));
-void *zdataalloc PROTOTYPE ((void *opaque, U_32 items, U_32 size));
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION _prototypes_public
-I_32 zip_getZipEntryData
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile, HyZipEntry * entry,
-            U_8 * buffer, U_32 bufferSize));
-I_32 zip_getZipEntryFromOffset
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile, HyZipEntry * entry,
-            IDATA offset));
-I_32 zip_establishCache
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile));
-void zip_resetZipFile
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-            IDATA * nextEntryPointer));
-I_32 zip_getNextZipEntry
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-            HyZipEntry * zipEntry, IDATA * nextEntryPointer));
-I_32 zip_getZipEntry
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile, HyZipEntry * entry,
-            const char *filename, BOOLEAN findDirectory));
-I_32 zip_getZipEntryExtraField
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile, HyZipEntry * entry,
-            U_8 * buffer, U_32 bufferSize));
-void zip_initZipEntry
-PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
-I_32 zip_openZipFile
-PROTOTYPE ((HyPortLibrary * portLib, char *filename, HyZipFile * zipFile,
-            HyZipCachePool * cachePool));
-void zip_freeZipEntry
-PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
-I_32 VMCALL zip_closeZipFile
-PROTOTYPE ((HyPortLibrary * portLib, struct HyZipFile * zipFile));
-I_32 zip_getZipEntryComment
-PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile, HyZipEntry * entry,
-            U_8 * buffer, U_32 bufferSize));
-
-#undef CDEV_CURRENT_FUNCTION
-
-//#include "hythread.h"
-//#define ENTER() hythread_monitor_enter(hythread_global_monitor())
-//#define EXIT() hythread_monitor_exit(hythread_global_monitor())
-
-#include "hymutex.h"
-MUTEX zip_globalMutex;
-static int initialized = 0;
-
-#define ENTER() \
-  if (!initialized) { MUTEX_INIT(zip_globalMutex); initialized = 1; } \
-  MUTEX_ENTER(zip_globalMutex);
-
-#define EXIT() MUTEX_EXIT(zip_globalMutex);
-
-
-HyZipCachePool *
-zipsup_GetZipCachePool(JNIEnv * env)
-{
-  static HyZipCachePool *pool = 0;
-
-  if (pool == 0) {
-    pool = zipCachePool_new(env);
-  }
-  return pool;
-}
-
-
-#ifndef checkZipLibrary
-#define CDEV_CURRENT_FUNCTION checkZipLibrary
-
-/*
-	Ensure that the zip library is loaded.
-	Return 0 on success, -1 on failure.
-*/
-I_32
-checkZipLibrary (HyPortLibrary * portLib)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  /* if the library has already been loaded return success/failure */
-  if (zipDLLDescriptor > 1)
-    return 0;
-  if (zipDLLDescriptor == 1)
-    return -1;
-
-  /* open up the zip library by name */
-
-  if (hysl_open_shared_library (HY_ZIP_DLL_NAME, &zipDLLDescriptor, TRUE))
-    goto openFailed;
-
-  /* look up the functions */
-  if (hysl_lookup_name
-      (zipDLLDescriptor, "inflateInit2_", (void *) &inflateInit2Func,
-       "ILILI"))
-    goto loadFailed;
-  if (hysl_lookup_name
-      (zipDLLDescriptor, "inflate", (void *) &inflateFunc, "IPI"))
-    goto loadFailed;
-  if (hysl_lookup_name
-      (zipDLLDescriptor, "inflateEnd", (void *) &inflateEndFunc, "IP"))
-    goto loadFailed;
-
-  /* good to go */
-  return 0;
-
-loadFailed:
-  hysl_close_shared_library (zipDLLDescriptor);
-
-  /* mark the descriptor as a failed load. only report the error once */
-  zipDLLDescriptor = 1;
-
-  /* Unable to open %s (Missing export) */
-  hynls_printf (PORTLIB, HYNLS_WARNING, HYNLS_ZIP_MISSING_EXPORT,
-                HY_ZIP_DLL_NAME);
-
-  return -1;
-
-openFailed:
-  /* mark the descriptor as a failed load. only report the error once */
-  zipDLLDescriptor = 1;
-
-  /* Unable to open %s (%s) */
-  hynls_printf (PORTLIB, HYNLS_WARNING, HYNLS_ZIP_UNABLE_TO_OPEN_ZIP_DLL,
-                HY_ZIP_DLL_NAME, hyerror_last_error_message ());
-  return -1;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-#endif
-
-#define CDEV_CURRENT_FUNCTION inflateData
-
-/*
-	Returns 0 on success or one of the following:
-			ZIP_ERR_UNSUPPORTED_FILE_TYPE
-			ZIP_ERR_FILE_CORRUPT
-			ZIP_ERR_OUT_OF_MEMORY
-			ZIP_ERR_INTERNAL_ERROR
-*/
-static I_32
-inflateData (struct workBuffer *workBuf, U_8 * inputBuffer,
-             U_32 inputBufferSize, U_8 * outputBuffer, U_32 outputBufferSize)
-{
-  PORT_ACCESS_FROM_PORT (workBuf->portLib);
-
-  z_stream stream;
-  I_32 err;
-
-  stream.next_in = inputBuffer;
-  stream.avail_in = inputBufferSize;
-  stream.next_out = outputBuffer;
-  stream.avail_out = outputBufferSize;
-
-  stream.opaque = workBuf;
-  stream.zalloc = zdataalloc;
-  stream.zfree = zdatafree;
-
-  /* Initialize stream. Pass "-15" as max number of window bits, negated
-     to indicate that no zlib header is present in the data. */
-  err = inflateInit2Func (&stream, -15, ZLIB_VERSION, sizeof (z_stream));
-  if (err != Z_OK)
-    return -1;
-
-  /* Inflate the data. */
-  err = inflateFunc (&stream, Z_SYNC_FLUSH);
-
-  /* Clean up the stream. */
-  inflateEndFunc (&stream);
-
-  /* Check the return code. Did we complete the inflate? */
-  if ((err == Z_STREAM_END) || (err == Z_OK))
-    {
-      if (stream.total_out == outputBufferSize)
-        {
-          return 0;
-        }
-    }
-
-  switch (err)
-    {
-    case Z_OK:                 /* an error if file is incomplete */
-    case Z_STREAM_END:         /* an error if file is incomplete */
-    case Z_ERRNO:              /* a random error */
-    case Z_STREAM_ERROR:       /* stream inconsistent */
-    case Z_DATA_ERROR:         /* corrupted zip */
-      return ZIP_ERR_FILE_CORRUPT;
-
-    case Z_VERSION_ERROR:      /* wrong zlib version */
-    case Z_NEED_DICT:          /* needs a preset dictionary that we can't provide */
-      return ZIP_ERR_UNSUPPORTED_FILE_TYPE;
-
-    case Z_MEM_ERROR:          /* out of memory */
-      return ZIP_ERR_OUT_OF_MEMORY;
-
-    case Z_BUF_ERROR:          /* no progress / out of output buffer */
-    default:                   /* jic */
-      return ZIP_ERR_INTERNAL_ERROR;
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION scanForCentralEnd
-/*
-	Scan backward from end of file for a central end header. Read from zipFile and update the HyZipCentralEnd provided.
-
-	Returns 0 on success or one of the following:
-			ZIP_ERR_FILE_READ_ERROR
-			ZIP_ERR_FILE_CORRUPT
-*/
-I_32
-scanForCentralEnd (HyPortLibrary * portLib, HyZipFile * zipFile,
-                   HyZipCentralEnd * endEntry)
-{
-  U_8 *current;
-  U_8 buffer[SCAN_CHUNK_SIZE];
-  I_32 i, size, state;
-  U_32 dataSize = 0;
-  I_64 seekResult;
-  I_32 fileSize;
-  I_32 bytesAlreadyRead = 0;
-
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  /* Haven't seen anything yet. */
-  state = 0;
-
-  seekResult = hyfile_seek (zipFile->fd, 0, HySeekEnd);
-  if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-    {
-      zipFile->pointer = -1;
-      return ZIP_ERR_FILE_READ_ERROR;
-    }
-  fileSize = (I_32) seekResult;
-  zipFile->pointer = fileSize;
-
-  while (TRUE)
-    {
-      /* Fill the buffer. */
-      if (bytesAlreadyRead == fileSize)
-        {
-          zipFile->pointer = -1;
-          return ZIP_ERR_FILE_CORRUPT;
-        }
-
-      size = SCAN_CHUNK_SIZE;
-      if (size > fileSize - bytesAlreadyRead)
-        size = fileSize - bytesAlreadyRead;
-      bytesAlreadyRead += size;
-      seekResult =
-        hyfile_seek (zipFile->fd, fileSize - bytesAlreadyRead, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer = (I_32) seekResult;
-
-      if (hyfile_read (zipFile->fd, buffer, size) != size)
-        {
-          zipFile->pointer = -1;
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer += size;
-
-      /* Scan the buffer (backwards) for CentralEnd signature = PK^E^F. */
-      for (i = size; i--; dataSize++)
-        {
-          switch (state)
-            {
-            case 0:
-              /* Nothing yet. */
-              if (buffer[i] == 6)
-                state = 1;
-              break;
-
-            case 1:
-              /* Seen ^F */
-              if (buffer[i] == 5)
-                state = 2;
-              else
-                state = 0;
-              break;
-
-            case 2:
-              /* Seen ^E^F */
-              if (buffer[i] == 'K')
-                state = 3;
-              else
-                state = 0;
-              break;
-
-            case 3:
-              /* Seen K^E^F */
-              if (buffer[i] == 'P' && dataSize >= 21)
-                {
-                  /* Found it.  Read the data from the end-of-central-dir record. */
-                  current = buffer + i + 4;
-                  (void) ZIP_NEXT_U16 (endEntry->diskNumber, current);
-                  (void) ZIP_NEXT_U16 (endEntry->dirStartDisk, current);
-                  (void) ZIP_NEXT_U16 (endEntry->thisDiskEntries, current);
-                  (void) ZIP_NEXT_U16 (endEntry->totalEntries, current);
-                  (void) ZIP_NEXT_U32 (endEntry->dirSize, current);
-                  (void) ZIP_NEXT_U32 (endEntry->dirOffset, current);
-                  (void) ZIP_NEXT_U16 (endEntry->commentLength, current);
-
-                  /* Quick test to ensure that the header isn't invalid. 
-                     Current dataSize is the number of bytes of data scanned, up to the ^H in the stream. */
-                  if (dataSize >= (U_32) (21 + endEntry->commentLength))
-                    return 0;
-
-                  /* Header looked invalid. Pretend we didn't see it and keep scanning.. */
-                }
-              state = 0;
-              break;
-            }
-        }
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION scanForDataDescriptor
-/*
-	Scan ahead for a data descriptor. Read from zipFile and update the HyZipLocalHeader provided.
-
-	Returns 0 on success or one of the following:
-			ZIP_ERR_FILE_READ_ERROR
-			ZIP_ERR_FILE_CORRUPT
-*/
-I_32
-scanForDataDescriptor (HyPortLibrary * portLib, HyZipFile * zipFile,
-                       HyZipEntry * zipEntry)
-{
-  U_8 *current;
-  U_8 buffer[SCAN_CHUNK_SIZE], descriptor[16];
-  I_32 i, size, state;
-  U_32 dataSize, blockPointer;
-  I_64 seekResult;
-
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  /* Skip ahead and read the data descriptor. The compressed size should be 0. */
-  if (zipFile->pointer !=
-      (IDATA) (zipEntry->dataPointer + zipEntry->compressedSize))
-    {
-      seekResult =
-        hyfile_seek (zipFile->fd,
-                     zipEntry->dataPointer + zipEntry->compressedSize,
-                     HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer = (I_32) seekResult;
-    }
-
-  /* Haven't seen anything yet. */
-  blockPointer = dataSize = zipEntry->compressedSize;
-  state = 0;
-
-  /* Scan until we find PK^G^H (otherwise it's an error). */
-  while (1)
-    {
-      /* Fill the buffer. */
-      size = hyfile_read (zipFile->fd, buffer, SCAN_CHUNK_SIZE);
-      if (size == 0)
-        {
-          return ZIP_ERR_FILE_CORRUPT;
-        }
-      else if (size < 0)
-        {
-          zipFile->pointer = -1;
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer += size;
-      blockPointer += size;
-
-      /* Scan the buffer. */
-      for (i = 0; i < size; i++, dataSize++)
-        {
-          switch (state)
-            {
-            case 0:
-              /* Nothing yet. */
-              if (buffer[i] == 'P')
-                {
-                  state = 1;
-                }
-              break;
-
-            case 1:
-              /* Seen P */
-              if (buffer[i] == 'K')
-                {
-                  state = 2;
-                }
-              else
-                state = 0;
-              break;
-
-            case 2:
-              /* Seen PK */
-              if (buffer[i] == 7)
-                {
-                  state = 3;
-                }
-              else
-                {
-                  state = 0;
-                }
-              break;
-
-            case 3:
-              /* Seen PK^G */
-              if (buffer[i] == 8)
-                {
-                  /* Found it! Read the descriptor */
-                  if (i + 12 < size)
-                    {
-                      current = &buffer[i + 1];
-                    }
-                  else
-                    {
-                      seekResult =
-                        hyfile_seek (zipFile->fd,
-                                     zipEntry->dataPointer + dataSize + 1,
-                                     HySeekSet);
-                      if ((seekResult < 0)
-                          || (seekResult > HYCONST64 (0x7FFFFFFF)))
-                        {
-                          zipFile->pointer = -1;
-                          return ZIP_ERR_FILE_READ_ERROR;
-                        }
-                      zipFile->pointer = (I_32) seekResult;
-                      if (hyfile_read (zipFile->fd, descriptor, 12) != 12)
-                        {
-                          zipFile->pointer = -1;
-                          return ZIP_ERR_FILE_READ_ERROR;
-                        }
-                      zipFile->pointer += 12;
-                      current = descriptor;
-                    }
-
-                  /* Read the data from the descriptor. */
-                  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
-                  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-                  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
-
-                  /* Quick test to ensure that the header isn't invalid. 
-                     Current dataSize is the number of bytes of data scanned, up to the ^H in the stream. */
-                  if (dataSize - 3 == zipEntry->compressedSize)
-                    {
-                      return 0;
-                    }
-
-                  /* Header looked invalid. Reset the pointer and continue scanning. */
-                  seekResult =
-                    hyfile_seek (zipFile->fd,
-                                 zipEntry->dataPointer + blockPointer,
-                                 HySeekSet);
-                  if ((seekResult < 0)
-                      || (seekResult > HYCONST64 (0x7FFFFFFF)))
-                    {
-                      zipFile->pointer = -1;
-                      return ZIP_ERR_FILE_READ_ERROR;
-                    }
-                  zipFile->pointer = (I_32) seekResult;
-                }
-              else
-                state = 0;
-              break;
-            }
-        }
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_populateCache
-/*
-	Fill in the cache of a given zip file.  This should only be called once during zip_openZipFile!
-
-	Returns 0 on success or one of the following:
-			ZIP_ERR_FILE_READ_ERROR
-			ZIP_ERR_FILE_OPEN_ERROR
-			ZIP_ERR_UNKNOWN_FILE_TYPE
-			ZIP_ERR_UNSUPPORTED_FILE_TYPE
-			ZIP_ERR_OUT_OF_MEMORY
-			ZIP_ERR_INTERNAL_ERROR
-*/
-I_32
-zip_populateCache (HyPortLibrary * portLib, HyZipFile * zipFile)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  I_32 result = 0;
-  IDATA bufferSize = 65536;
-  IDATA unreadSize = 0;
-  IDATA bufferedSize = 0;
-  IDATA bytesToRead = 0;
-  IDATA filenameCopied;
-  HyZipEntry entry;
-  HyZipCentralEnd endEntry;
-  U_8 *buffer = NULL;
-  U_8 *filename = NULL;
-  IDATA filenameSize = 256;     /* Should be sufficient for most filenames */
-  U_8 *current;
-  U_32 sig;
-  U_32 localHeaderOffset;
-  IDATA startCentralDir;
-  I_64 seekResult;
-
-  if (!zipFile->cache)
-    return ZIP_ERR_INTERNAL_ERROR;
-
-  /* Find and read the end-of-central-dir record. */
-  result = scanForCentralEnd (portLib, zipFile, &endEntry);
-  if (result != 0)
-    return result;
-
-  unreadSize = endEntry.dirSize + 4 /* slop */ ;
-  zipFile->cache->startCentralDir = startCentralDir =
-    (IDATA) ((UDATA) endEntry.dirOffset);
-
-  if (zipFile->pointer != startCentralDir)
-    {
-      seekResult = hyfile_seek (zipFile->fd, startCentralDir, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-
-      zipFile->pointer = (I_32) seekResult;
-      if (zipFile->pointer != startCentralDir)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          zipFile->pointer = -1;
-          goto finished;
-        }
-    }
-
-  /* No point in allocating more than we'll actually need.. */
-  if (bufferSize > unreadSize)
-    bufferSize = unreadSize;
-
-  filename = hymem_allocate_memory (filenameSize);
-  if (!filename)
-    {
-      result = ZIP_ERR_OUT_OF_MEMORY;
-      goto finished;
-    }
-
-  /* Allocate some space to hold central directory goo as we eat through it */
-  buffer = hymem_allocate_memory (bufferSize);
-  if (!buffer && (bufferSize > 4096))
-    {
-      /* Not enough memory, fall back to a smaller buffer! */
-      bufferSize = 4096;
-      buffer = hymem_allocate_memory (bufferSize);
-    }
-  if (!buffer)
-    {
-      result = ZIP_ERR_OUT_OF_MEMORY;
-      goto finished;
-    }
-
-  while (unreadSize)
-    {
-
-      /* Read as much as needed into buffer. */
-      bytesToRead = bufferSize - bufferedSize;
-      if (bytesToRead > unreadSize)
-        bytesToRead = unreadSize;
-      result = hyfile_read (zipFile->fd, buffer + bufferedSize, bytesToRead);
-      if (result < 0)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          zipFile->pointer = -1;
-          goto finished;
-        }
-      zipFile->pointer += result;
-      unreadSize -= result;
-      bufferedSize += result;
-      current = buffer;
-
-      /* consume entries until we run out. */
-      while (current + 46 < buffer + bufferedSize)
-        {
-          IDATA entryPointer;
-
-          entryPointer =
-            zipFile->pointer + (current - (buffer + bufferedSize));
-
-          sig = 0;
-          (void) ZIP_NEXT_U32 (sig, current);
-          if (sig == ZIP_CentralEnd)
-            {
-              /* We're done here. */
-              result = 0;
-              goto finished;
-            }
-          if (sig != ZIP_CentralHeader)
-            {
-              /* Umm...What the Hell? */
-              result = ZIP_ERR_FILE_CORRUPT;
-              goto finished;
-            }
-
-          /* Read ZIP_CentralHeader entry */
-          (void) ZIP_NEXT_U16 (entry.versionCreated, current);
-          (void) ZIP_NEXT_U16 (entry.versionNeeded, current);
-          (void) ZIP_NEXT_U16 (entry.flags, current);
-          (void) ZIP_NEXT_U16 (entry.compressionMethod, current);
-          (void) ZIP_NEXT_U16 (entry.lastModTime, current);
-          (void) ZIP_NEXT_U16 (entry.lastModDate, current);
-          (void) ZIP_NEXT_U32 (entry.crc32, current);
-          (void) ZIP_NEXT_U32 (entry.compressedSize, current);
-          (void) ZIP_NEXT_U32 (entry.uncompressedSize, current);
-          (void) ZIP_NEXT_U16 (entry.filenameLength, current);
-          (void) ZIP_NEXT_U16 (entry.extraFieldLength, current);
-          (void) ZIP_NEXT_U16 (entry.fileCommentLength, current);
-          current += sizeof (U_16);     /* skip disk number field */
-          (void) ZIP_NEXT_U16 (entry.internalAttributes, current);
-          current += sizeof (U_32);     /* skip external attributes field */
-          (void) ZIP_NEXT_U32 (localHeaderOffset, current);
-
-          /* Increase filename buffer size if necessary. */
-          if (filenameSize < entry.filenameLength + 1)
-            {
-              hymem_free_memory (filename);
-              filenameSize = entry.filenameLength + 1;
-              filename = hymem_allocate_memory (filenameSize);
-              if (!filename)
-                {
-                  result = ZIP_ERR_OUT_OF_MEMORY;
-                  goto finished;
-                }
-            }
-
-          filenameCopied = 0;
-          while (filenameCopied < entry.filenameLength)
-            {
-              IDATA size;
-              /* Copy as much of the filename as we can see in the buffer (probably the whole thing). */
-
-              size = entry.filenameLength - filenameCopied;
-              if (size > bufferedSize - (current - buffer))
-                {
-                  size = bufferedSize - (current - buffer);
-                }
-              memcpy (filename + filenameCopied, current, size);
-              filenameCopied += size;
-              current += size;
-              if (filenameCopied >= entry.filenameLength)
-                break;          /* done */
-
-              /* Otherwise, we ran out of source string.  Load another chunk.. */
-              bufferedSize = 0;
-              if (!unreadSize)
-                {
-                  /* Central header is supposedly done?  Bak */
-                  result = ZIP_ERR_FILE_CORRUPT;
-                  goto finished;
-                }
-              bytesToRead = bufferSize - bufferedSize;
-              if (bytesToRead > unreadSize)
-                bytesToRead = unreadSize;
-              result =
-                hyfile_read (zipFile->fd, buffer + bufferedSize, bytesToRead);
-              if (result < 0)
-                {
-                  result = ZIP_ERR_FILE_READ_ERROR;
-                  zipFile->pointer = -1;
-                  goto finished;
-                }
-              zipFile->pointer += result;
-              unreadSize -= result;
-              bufferedSize += result;
-              current = buffer;
-            }
-          filename[entry.filenameLength] = '\0';        /* null-terminate */
-
-          if (((entry.compressionMethod == ZIP_CM_Deflated)
-               && (entry.flags & 0x8)) || (entry.fileCommentLength != 0))
-            {
-              /* Either local header doesn't know the compressedSize, or this entry has a file
-                 comment.  In either case, cache the central header instead of the local header
-                 so we can find the information we need later. */
-
-              result =
-                zipCache_addElement (zipFile->cache, (char *) filename,
-                                     entryPointer);
-
-            }
-          else
-            {
-              result =
-                zipCache_addElement (zipFile->cache, (char *) filename,
-                                     localHeaderOffset);
-            }
-
-          if (!result)
-            {
-              result = ZIP_ERR_OUT_OF_MEMORY;
-              goto finished;
-            }
-
-          /* Skip the data and comment. */
-          bytesToRead = entry.extraFieldLength + entry.fileCommentLength;
-          if (bufferedSize - (current - buffer) >= bytesToRead)
-            {
-              current += bytesToRead;
-            }
-          else
-            {
-              /* The rest of the buffer is uninteresting.  Skip ahead to where the good stuff is */
-              bytesToRead -= (bufferedSize - (current - buffer));
-              current = buffer + bufferedSize;
-              unreadSize -= bytesToRead;
-
-              seekResult = hyfile_seek (zipFile->fd, bytesToRead, HySeekCur);
-              if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-                {
-                  zipFile->pointer = -1;
-                  result = ZIP_ERR_FILE_READ_ERROR;
-                  goto finished;
-                }
-              zipFile->pointer = (I_32) seekResult;
-            }
-        }
-      bufferedSize -= (current - buffer);
-      memmove (buffer, current, bufferedSize);
-    }
-
-  result = 0;
-
-finished:
-  if (filename)
-    hymem_free_memory (filename);
-  if (buffer)
-    hymem_free_memory (buffer);
-  return result;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION readZipEntry
-/*
-	Read the next zip entry for the zipFile into the zipEntry provided.  If filename is non-NULL, it is expected to match
-	the filename read for the entry.  If (cachePointer != -1) the filename of the entry will be looked up in the cache (assuming
-	there is one) to help detect use of an invalid cache.  If enumerationPointer is non-NULL, sequential access is assumed and
-	either a local zip entry or a data descriptor will be accepted, but a central zip entry will cause ZIP_ERR_NO_MORE_ENTRIES
-	to be returned.  If enumerationPointer is NULL, random access is assumed and either a local zip entry or a central zip
-	entry will be accepted.
-
-	Returns 0 on success or one of the following:
-			ZIP_ERR_FILE_READ_ERROR
-			ZIP_ERR_FILE_CORRUPT
-			ZIP_ERR_OUT_OF_MEMORY
-			ZIP_ERR_NO_MORE_ENTRIES
-*/
-static I_32
-readZipEntry (HyPortLibrary * portLib, HyZipFile * zipFile,
-              HyZipEntry * zipEntry, const char *filename,
-              IDATA * enumerationPointer, IDATA * entryStart,
-              BOOLEAN findDirectory)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  I_32 result;
-  U_8 buffer[46 + 128];
-  U_8 *current;
-  U_32 sig;
-  IDATA readLength;
-  I_64 seekResult;
-  U_8 *readBuffer;
-  IDATA currentEntryPointer, localEntryPointer;
-  IDATA headerSize;
-  IDATA filenameLength = filename ? strlen (filename) : 0;
-
-retry:
-  if (entryStart)
-    *entryStart = zipFile->pointer;
-  readBuffer = NULL;
-  /* Guess how many bytes we'll need to read.  If we guess correctly we will do fewer I/O operations */
-  headerSize = 30;              /* local zip header size */
-  if (zipFile->cache && (zipFile->pointer >= zipFile->cache->startCentralDir))
-    {
-      headerSize = 46;          /* central zip header size */
-    }
-  readLength = headerSize + (filename ? filenameLength : 128);
-  if (findDirectory)
-    {
-      /* Extra byte for possible trailing '/' */
-      readLength++;
-    }
-
-  /* Allocate some memory if necessary */
-  if (readLength <= sizeof (buffer))
-    {
-      current = buffer;
-    }
-  else
-    {
-      current = readBuffer = hymem_allocate_memory (readLength);
-      if (!readBuffer)
-        return ZIP_ERR_OUT_OF_MEMORY;
-    }
-
-  currentEntryPointer = localEntryPointer = zipFile->pointer;
-
-  result = hyfile_read (zipFile->fd, current, readLength);
-  if ((result < 22)
-      || (filename
-          && !(result == readLength
-               || (findDirectory && result == (readLength - 1)))))
-    {
-      /* We clearly didn't get enough bytes */
-      result = ZIP_ERR_FILE_READ_ERROR;
-      goto finished;
-    }
-  zipFile->pointer += result;
-  readLength = result;          /* If it's not enough, we'll catch that later */
-  (void) ZIP_NEXT_U32 (sig, current);
-
-  if (enumerationPointer)
-    {
-      if ((sig == ZIP_CentralEnd))
-        {
-          result = ZIP_ERR_NO_MORE_ENTRIES;
-          goto finished;
-        }
-    }
-  if ((enumerationPointer || (!zipFile->cache))
-      && (sig == ZIP_DataDescriptor))
-    {
-      /* We failed to predict a data descriptor here.  This should be an error (i.e. only happens in malformed zips?) 
-         but, but we will silently skip over it */
-      seekResult =
-        hyfile_seek (zipFile->fd, currentEntryPointer + 16, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer = (I_32) seekResult;
-
-      if (zipFile->pointer == currentEntryPointer + 16)
-        {
-          if (readBuffer)
-            {
-              hymem_free_memory (readBuffer);
-            }
-          goto retry;
-        }
-      result = ZIP_ERR_FILE_READ_ERROR;
-      goto finished;
-    }
-
-  if ((sig != ZIP_CentralHeader) && (sig != ZIP_LocalHeader))
-    {
-      /* Unexpected. */
-      result = ZIP_ERR_FILE_CORRUPT;
-      goto finished;
-    }
-  headerSize = ((sig == ZIP_CentralHeader) ? 46 : 30);
-  if (readLength < headerSize)
-    {
-      /* We didn't get the whole header (and none of the filename).. */
-      /* NOTE: this could happen in normal use if the assumed filename length above is <16.  Since it's 128, we don't 
-         handle the impossible case where we would have to read more header.  It could also happen if the caller
-         supplied a filename of length <16 but that only happens when we have a cache (so we'll know the header size) 
-       */
-      result = ZIP_ERR_FILE_READ_ERROR;
-    }
-  readLength -= headerSize;
-
-  if (sig == ZIP_CentralHeader)
-    {
-      current += 2;             /* skip versionCreated field */
-    }
-  (void) ZIP_NEXT_U16 (zipEntry->versionNeeded, current);
-  (void) ZIP_NEXT_U16 (zipEntry->flags, current);
-  (void) ZIP_NEXT_U16 (zipEntry->compressionMethod, current);
-  (void) ZIP_NEXT_U16 (zipEntry->lastModTime, current);
-  (void) ZIP_NEXT_U16 (zipEntry->lastModDate, current);
-  (void) ZIP_NEXT_U32 (zipEntry->crc32, current);
-  (void) ZIP_NEXT_U32 (zipEntry->compressedSize, current);
-  (void) ZIP_NEXT_U32 (zipEntry->uncompressedSize, current);
-  (void) ZIP_NEXT_U16 (zipEntry->filenameLength, current);
-  (void) ZIP_NEXT_U16 (zipEntry->extraFieldLength, current);
-  zipEntry->fileCommentLength = 0;
-
-  if (sig == ZIP_CentralHeader)
-    {
-      (void) ZIP_NEXT_U16 (zipEntry->fileCommentLength, current);
-      current += 8;             /* skip disk number start + internal attrs + external attrs */
-      (void) ZIP_NEXT_U32 (localEntryPointer, current);
-    }
-
-  if (filename)
-    {
-      if (zipFile->cache)
-        {
-          if (!
-              (readLength == zipEntry->filenameLength
-               || (findDirectory
-                   && (readLength - 1) == zipEntry->filenameLength)))
-            {
-              /* We knew exactly how much we were supposed to read, and this wasn't it */
-              result = ZIP_ERR_FILE_CORRUPT;
-              goto finished;
-            }
-        }
-    }
-
-  /* Allocate space for filename */
-  if (zipEntry->filenameLength >= ZIP_INTERNAL_MAX)
-    {
-      zipEntry->filename =
-        hymem_allocate_memory (zipEntry->filenameLength + 1);
-      if (!zipEntry->filename)
-        {
-          result = ZIP_ERR_OUT_OF_MEMORY;
-          goto finished;
-        }
-    }
-  else
-    {
-      zipEntry->filename = zipEntry->internalFilename;
-    }
-  if (readLength > zipEntry->filenameLength)
-    {
-      readLength = zipEntry->filenameLength;
-    }
-  memcpy (zipEntry->filename, current, readLength);
-
-  /* Read the rest of the filename if necessary.  Allocate space in HyZipEntry for it! */
-  if (readLength < zipEntry->filenameLength)
-    {
-      result =
-        hyfile_read (zipFile->fd, zipEntry->filename + readLength,
-                     zipEntry->filenameLength - readLength);
-      if (result != (zipEntry->filenameLength - readLength))
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer += result;
-    }
-  zipEntry->filename[zipEntry->filenameLength] = '\0';
-
-  /* If we know what filename is supposed to be, compare it and make sure it matches */
-  /* Note: CASE-SENSITIVE COMPARE because filenames in zips are case sensitive (even on platforms with
-     case-insensitive file systems) */
-  if (filename)
-    {
-      if (!
-          ((findDirectory && zipEntry->filenameLength == (filenameLength + 1)
-            && zipEntry->filename[filenameLength] == '/'
-            && !strncmp ((char *) zipEntry->filename, (const char *) filename,
-                         filenameLength))
-           || !strcmp ((const char *) zipEntry->filename,
-                       (const char *) filename)))
-        {
-          /* We seem to have read something totally invalid.. */
-          result = ZIP_ERR_FILE_CORRUPT;
-          goto finished;
-        }
-    }
-
-  zipEntry->filenamePointer = currentEntryPointer + headerSize;
-  zipEntry->extraFieldPointer =
-    localEntryPointer + 30 + zipEntry->filenameLength;
-  zipEntry->dataPointer =
-    zipEntry->extraFieldPointer + zipEntry->extraFieldLength;
-  zipEntry->extraField = NULL;
-  zipEntry->fileCommentPointer = 0;
-  zipEntry->fileComment = NULL;
-  zipEntry->data = NULL;
-
-  if (sig == ZIP_CentralHeader)
-    {
-      U_8 buf[2];
-      U_8 *buf2 = buf;
-      U_16 lost;
-      /* Also, we know where the comment is */
-      zipEntry->fileCommentPointer = currentEntryPointer + headerSize +
-        zipEntry->filenameLength + zipEntry->extraFieldLength;
-      if (hyfile_seek (zipFile->fd, localEntryPointer + 28, HySeekSet) ==
-          localEntryPointer + 28)
-        {
-          if (hyfile_read (zipFile->fd, buf, 2) == 2)
-            {
-              (void) ZIP_NEXT_U16 (lost, buf2);
-              zipEntry->dataPointer = zipEntry->extraFieldPointer + lost;
-              zipFile->pointer = localEntryPointer + 30;
-            }
-        }
-    }
-
-  if ((sig == ZIP_LocalHeader)
-      && (zipEntry->compressionMethod == ZIP_CM_Deflated)
-      && (zipEntry->flags & 0x8))
-    {
-      /* What we just read doesn't tell us how big the compressed data is.  We have to do a heuristic search for a
-         valid data descriptor at the end of the compressed text */
-      result = scanForDataDescriptor (portLib, zipFile, zipEntry);
-      if (result < 0)
-        goto finished;
-    }
-
-  /* Entry read successfully */
-
-  if (enumerationPointer)
-    {
-      /* Work out where the next entry is supposed to be */
-      *enumerationPointer =
-        zipEntry->fileCommentPointer + zipEntry->fileCommentLength;
-    }
-
-  if (readBuffer)
-    hymem_free_memory (readBuffer);
-  return 0;
-
-finished:
-  if (readBuffer)
-    {
-      hymem_free_memory (readBuffer);
-    }
-  if ((zipEntry->filename)
-      && (zipEntry->filename != zipEntry->internalFilename))
-    {
-      hymem_free_memory (zipEntry->filename);
-    }
-  zipEntry->filename = NULL;
-  if (result == ZIP_ERR_FILE_READ_ERROR)
-    {
-      zipFile->pointer = -1;
-    }
-  return result;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_closeZipFile
-/**
- * Attempt to close the zipfile. 
- *
- * @param[in] portLib the port library
- * @param[in] zipFile The zip file to be closed
- *
- * @return 0 on success
- * @return 	ZIP_ERR_FILE_CLOSE_ERROR if there is an error closing the file
- * @return 	ZIP_ERR_INTERNAL_ERROR if there is an internal error
- *
-*/
-I_32 VMCALL
-zip_closeZipFile (HyPortLibrary * portLib, struct HyZipFile * zipFile)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-  IDATA fd;
-
-  ENTER ();
-
-  fd = zipFile->fd;
-  zipFile->fd = -1;
-
-  if (zipFile->cache && zipFile->cachePool)
-    {
-      zipCachePool_release (zipFile->cachePool, zipFile->cache);
-      zipFile->cache = NULL;
-    }
-  if ((zipFile->filename) && (zipFile->filename != zipFile->internalFilename))
-    {
-      hymem_free_memory (zipFile->filename);
-    }
-  zipFile->filename = NULL;
-
-  if (fd == -1)
-    {
-      EXIT ();
-      return ZIP_ERR_INTERNAL_ERROR;
-    }
-  if (hyfile_close (fd))
-    {
-      EXIT ();
-      return ZIP_ERR_FILE_CLOSE_ERROR;
-    }
-  EXIT ();
-  return 0;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_establishCache
-/** 
- * Called to set up a cache when a zip file is opened with a cachePool but without a cache, or when the
- *	current cache is found to be invalid in some way.
- * 
- * @param[in] portLib the port library
- * @param[in] zipFile the zip file for which we want to establish a cache
- * 
- * The current cache is marked as invalid such that new instances of zip files 
- * won't try to use it and an attempt is made to establish a new cache.
- *
- * @return 0 on success
- * @return 	ZIP_ERR_FILE_READ_ERROR if there is an error reading from zipFile 
- * @return	ZIP_ERR_FILE_OPEN_ERROR if is there is an error opening the file 
- * @return	ZIP_ERR_UNKNOWN_FILE_TYPE if the file type is unknown
- * @return	ZIP_ERR_UNSUPPORTED_FILE_TYPE if the file type is unsupported
- * @return	ZIP_ERR_OUT_OF_MEMORY  if there is not enough memory to complete this call
- * @return	ZIP_ERR_INTERNAL_ERROR if there was an internal error
-*/
-
-I_32
-zip_establishCache (HyPortLibrary * portLib, HyZipFile * zipFile)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-  I_32 result;
-  I_64 timeStamp, actualFileSize;
-  IDATA fileSize, filenameLength;
-
-  if (zipFile->cache)
-    {
-      if (zipFile->cachePool)
-        {
-          /* Whack cache timestamp to keep other people from starting to use it (we will create a new one for them
-             to start to use instead).  Once all the current users of the cache have stopped using it, it will go away */
-          zipFile->cache->zipTimeStamp = -2;
-          zipCachePool_release (zipFile->cachePool, zipFile->cache);
-        }
-      zipFile->cache = NULL;
-    }
-  if (!zipFile->cachePool)
-    {
-      return ZIP_ERR_INTERNAL_ERROR;
-    }
-
-  /* Check the cachePool for a suitable cache. */
-  filenameLength = strlen ((const char *) zipFile->filename);
-
-//  timeStamp = hyfile_lastmod ((const char *) zipFile->filename);
-//  actualFileSize = hyfile_length ((const char *) zipFile->filename);
-  {
-    struct stat st;
-    tzset ();
-    stat ((mcSignednessBull)zipFile->filename, &st);
-    timeStamp = (U_64)st.st_mtime * 1000;
-    actualFileSize = (I_64) st.st_size;
-  }
-
-  if ((actualFileSize < 0) || (actualFileSize > HYCONST64 (0x7FFFFFFF)))
-    {
-      return ZIP_ERR_INTERNAL_ERROR;
-    }
-  fileSize = (IDATA) actualFileSize;
-
-  zipFile->cache =
-    zipCachePool_findCache (zipFile->cachePool,
-                            (const char *) zipFile->filename, filenameLength,
-                            fileSize, timeStamp);
-  if (!zipFile->cache)
-    {
-      /* Build a new cache.  Because caller asked for a cache, fail if we can't provide one */
-      zipFile->cache =
-        zipCache_new (portLib, (char *) zipFile->filename, filenameLength);
-      if (!zipFile->cache)
-        return ZIP_ERR_OUT_OF_MEMORY;
-
-      zipFile->cache->zipFileSize = fileSize;
-      zipFile->cache->zipTimeStamp = timeStamp;
-
-      result = zip_populateCache (portLib, zipFile);
-      if (result != 0)
-        {
-          zipCache_kill (zipFile->cache);
-          zipFile->cache = NULL;
-          return result;
-        }
-      if (!zipCachePool_addCache (zipFile->cachePool, zipFile->cache))
-        {
-          zipCache_kill (zipFile->cache);
-          zipFile->cache = NULL;
-          return ZIP_ERR_OUT_OF_MEMORY;
-        }
-    }
-  return 0;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_initZipEntry
-/**
- * Initialize a zip entry.
- * 
- * Should be called before the entry is passed to any other zip support functions 
- *
- * @param[in] portLib the port library
- * @param[in] entry the zip entry to init
- *
- * @return none
-*/
-
-void
-zip_initZipEntry (HyPortLibrary * portLib, HyZipEntry * entry)
-{
-  memset (entry, 0, sizeof (*entry));
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_freeZipEntry
-/**
- * Free any memory associated with a zip entry.
- * 
- * @param[in] portLib the port library
- * @param[in] entry the zip entry we are freeing 
- * 
- * @return none 
- * 
- * @note This does not free the entry itself.
-*/
-
-void
-zip_freeZipEntry (HyPortLibrary * portLib, HyZipEntry * entry)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-
-  if ((entry->filename) && (entry->filename != entry->internalFilename))
-    {
-      hymem_free_memory (entry->filename);
-    }
-  entry->filename = NULL;
-  if (entry->extraField)
-    {
-      hymem_free_memory (entry->extraField);
-      entry->extraField = NULL;
-    }
-  if (entry->data)
-    {
-      hymem_free_memory (entry->data);
-      entry->data = NULL;
-    }
-  if (entry->fileComment)
-    {
-      hymem_free_memory (entry->fileComment);
-      entry->fileComment = NULL;
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getNextZipEntry
-/**
- *	Read the next zip entry at nextEntryPointer into zipEntry.
- *	
- * Any memory held onto by zipEntry may be lost, and therefore
- *	MUST be freed with @ref zip_freeZipEntry first.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile The zip file being read
- * @param[out] zipEntry compressed data is placed here
- * @param[in] nextEntryPointer
- * 
- * @return 0 on success
- * @return 	ZIP_ERR_FILE_READ_ERROR if there is an error reading zipFile
- * @return ZIP_ERR_FILE_CORRUPT if zipFile is corrupt
- * @return 	ZIP_ERR_NO_MORE_ENTRIES if there are no more entries in zipFile
- * @return 	ZIP_ERR_OUT_OF_MEMORY if there is not enough memory to complete this call
- *
- * @see zip_freeZipEntry
- *
-*/
-I_32
-zip_getNextZipEntry (HyPortLibrary * portLib, HyZipFile * zipFile,
-                     HyZipEntry * zipEntry, IDATA * nextEntryPointer)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-  IDATA result;
-  BOOLEAN retryAllowed = TRUE;
-  IDATA pointer;
-  IDATA entryStart;
-  I_64 seekResult;
-
-  ENTER ();
-
-retry:
-  pointer = *nextEntryPointer;
-
-  /* Seek to the entry's position in the file. */
-  if (pointer != zipFile->pointer)
-    {
-      seekResult = hyfile_seek (zipFile->fd, pointer, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          EXIT ();
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer = (I_32) seekResult;
-
-      if (pointer != zipFile->pointer)
-        {
-          zipFile->pointer = -1;
-          EXIT ();
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-    }
-
-  /* Read the entry */
-  entryStart = *nextEntryPointer;
-  result =
-    readZipEntry (portLib, zipFile, zipEntry, NULL, &pointer, &entryStart,
-                  FALSE);
-  if (result != 0)
-    {
-      if (!retryAllowed || (result == ZIP_ERR_NO_MORE_ENTRIES))
-        {
-          EXIT ();
-          return result;
-        }
-      zip_establishCache (portLib, zipFile);
-      retryAllowed = FALSE;
-      goto retry;
-    }
-
-  if (zipFile->cache)
-    {
-      /* Validity check: look up filename in the cache... */
-      result =
-        (IDATA) zipCache_findElement (zipFile->cache,
-                                      (const char *) zipEntry->filename,
-                                      FALSE);
-      if (result != entryStart)
-        {
-          if (result >= zipFile->cache->startCentralDir)
-            {
-              /* ! Cache contents are not valid.  Invalidate it and make a new one */
-              if (!retryAllowed)
-                {
-                  EXIT ();
-                  return ZIP_ERR_FILE_CORRUPT;  /* should never happen! */
-                }
-              result = zip_establishCache (portLib, zipFile);
-              if (!result)
-                {
-                  /* (silently start operating without a cache if we couldn't make a new one) */
-                }
-              else
-                {
-                  retryAllowed = FALSE;
-                  goto retry;
-                }
-            }
-          else
-            {
-              /* We know that the central header for this entry contains info that the
-                 local header is missing (comment length and/or uncompressed size) */
-              zipEntry->fileCommentPointer = -1;
-            }
-        }
-    }
-
-  *nextEntryPointer = pointer;
-  EXIT ();
-  return 0;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntry
-/**
- *	Attempt to find and read the zip entry corresponding to filename.
- *	If found, read the entry into the parameter entry. 
- *
- * If an uncached entry is found, the filename field will be filled in. This
- * memory will have to be freed with @ref zip_freeZipEntry.
- * 
- * @param[in] portLib the port library
- * @param[in] zipFile the file being read from
- * @param[out] entry the zip entry found in zipFile is read to here
- * @param[in] filename the name of the file that corresponds to entry
- * @param[in] findDirectory when true, match a directory even if filename does not end in '/'.
- *			Note findDirectory is only supported (for the JCL) when there is a cache
- *
- * @return 0 on success or one of the following:
- * @return	ZIP_ERR_FILE_READ_ERROR if there is an error reading from zipFile
- * @return	ZIP_ERR_FILE_CORRUPT if zipFile is corrupt
- * @return	ZIP_ERR_ENTRY_NOT_FOUND if a zip entry with name filename was not found
- * @return 	ZIP_ERR_OUT_OF_MEMORY if there is not enough memory to complete this call
- *
- * @see zip_freeZipEntry
-*/
-
-I_32
-zip_getZipEntry (HyPortLibrary * portLib, HyZipFile * zipFile,
-                 HyZipEntry * entry, const char *filename,
-                 BOOLEAN findDirectory)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-  IDATA result, position;
-  BOOLEAN retryAllowed = TRUE;
-  I_64 seekResult;
-
-  ENTER ();
-
-retry:
-  if (zipFile->cache)
-    {
-      /* Look up filename in the cache. */
-      position =
-        (IDATA) zipCache_findElement (zipFile->cache, filename,
-                                      findDirectory);
-      if (position == -1)
-        {
-          /* Note: we assume the cache is still valid here */
-          EXIT ();
-          return ZIP_ERR_ENTRY_NOT_FOUND;
-        }
-
-      /* Seek to the entry's position in the file. */
-      if (zipFile->pointer != position)
-        {
-          seekResult = hyfile_seek (zipFile->fd, position, HySeekSet);
-          if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-            {
-              zipFile->pointer = -1;
-              EXIT ();
-              return ZIP_ERR_FILE_READ_ERROR;
-            }
-          zipFile->pointer = (I_32) seekResult;
-
-          if (zipFile->pointer != position)
-            {
-              zipFile->pointer = -1;
-              EXIT ();
-              return ZIP_ERR_FILE_READ_ERROR;
-            }
-        }
-
-      /* Read the entry */
-      result =
-        readZipEntry (portLib, zipFile, entry, filename, NULL, NULL,
-                      findDirectory);
-      if (result != 0)
-        {
-          if (!retryAllowed)
-            {
-              EXIT ();
-              return result;
-            }
-          result = zip_establishCache (portLib, zipFile);       /* invalidate existing cache */
-          if (result)
-            {
-              EXIT ();
-              return result;
-            }
-          retryAllowed = FALSE;
-          goto retry;
-        }
-      EXIT ();
-      return 0;
-    }
-  else
-    {
-      /* Uh oh -- random access without a cache (SLOW!) */
-      position = 0;
-      zip_resetZipFile (PORTLIB, zipFile, &position);
-      while (TRUE)
-        {
-
-          if (zipFile->pointer != position)
-            {
-              seekResult = hyfile_seek (zipFile->fd, position, HySeekSet);
-              if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-                {
-                  zipFile->pointer = -1;
-                  EXIT ();
-                  return ZIP_ERR_FILE_READ_ERROR;
-                }
-              zipFile->pointer = (I_32) seekResult;
-
-              if (zipFile->pointer != position)
-                {
-                  zipFile->pointer = -1;
-                  EXIT ();
-                  return ZIP_ERR_FILE_READ_ERROR;
-                }
-            }
-
-          result =
-            readZipEntry (portLib, zipFile, entry, NULL, &position, NULL,
-                          FALSE);
-          if (result || !strcmp ((const char *) entry->filename, filename))
-            {
-              EXIT ();
-              return result;
-            }
-
-          /* No match.  Reset for next entry */
-          zip_freeZipEntry (portLib, entry);
-          zip_initZipEntry (portLib, entry);
-        }
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntryData
-/** 
- *	Attempt to read and uncompress the data for the zip entry entry.
- * 
- *	If buffer is non-NULL it is used, but not explicitly held onto by the entry.
- *	If buffer is NULL, memory is allocated and held onto by the entry, and thus
- *	should later be freed with @ref zip_freeZipEntry.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile the zip file being read from.
- * @param[in,out] entry the zip entry
- * @param[in] buffer may or may not be NULL
- * @param[in] bufferSize
-
- * @return 0 on success
- * @return	ZIP_ERR_FILE_READ_ERROR if there is an error reading from zipEntry
- * @return	ZIP_ERR_FILE_CORRUPT if zipFile is corrupt
- * @return	ZIP_ERR_ENTRY_NOT_FOUND if entry is not found
- * @return 	ZIP_ERR_OUT_OF_MEMORY  if there is not enough memory to complete this call
- * @return 	ZIP_ERR_BUFFER_TOO_SMALL if buffer is too small to hold the comment for zipFile
- *
- * @see zip_freeZipEntry
- *
-*/
-I_32
-zip_getZipEntryData (HyPortLibrary * portLib, HyZipFile * zipFile,
-                     HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-
-  I_32 result;
-  U_8 *dataBuffer;
-  struct workBuffer wb;
-  I_64 seekResult;
-
-  ENTER ();
-
-  wb.portLib = portLib;
-  wb.bufferStart = wb.bufferEnd = wb.currentAlloc = 0;
-
-  if (buffer)
-    {
-      if (bufferSize < entry->uncompressedSize)
-        {
-          EXIT ();
-          return ZIP_ERR_BUFFER_TOO_SMALL;
-        }
-      dataBuffer = buffer;
-    }
-  else
-    {
-      /* Note that this is the first zalloc. This memory must be available to the calling method and is freed explicitly in zip_freeZipEntry. */
-      /* Note that other allocs freed in zip_freeZipEntry are not alloc'd using zalloc */
-      dataBuffer = zdataalloc (&wb, 1, entry->uncompressedSize);
-      if (!dataBuffer)
-        {
-          EXIT ();
-          return ZIP_ERR_OUT_OF_MEMORY;
-        }
-      entry->data = dataBuffer;
-    }
-
-  if (entry->compressionMethod == ZIP_CM_Stored)
-    {
-      /* No compression - just read the data in. */
-      if (zipFile->pointer != entry->dataPointer)
-        {
-          seekResult =
-            hyfile_seek (zipFile->fd, entry->dataPointer, HySeekSet);
-          if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-            {
-              zipFile->pointer = -1;
-              result = ZIP_ERR_FILE_READ_ERROR;
-              goto finished;
-            }
-          zipFile->pointer = (I_32) seekResult;
-
-          if (zipFile->pointer != entry->dataPointer)
-            {
-              result = ZIP_ERR_FILE_READ_ERROR;
-              goto finished;
-            }
-        }
-      result = hyfile_read (zipFile->fd, dataBuffer, entry->compressedSize);
-      if (result != (I_32) entry->compressedSize)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer += result;
-      EXIT ();
-      return 0;
-    }
-
-  if (entry->compressionMethod == ZIP_CM_Deflated)
-    {
-      U_8 *readBuffer;
-
-      /* Ensure that the library is loaded. */
-     if (checkZipLibrary (portLib))
-        {
-          result = ZIP_ERR_UNSUPPORTED_FILE_TYPE;
-          goto finished;
-        }
-
-      /* Read the file contents. */
-      readBuffer = zdataalloc (&wb, 1, entry->compressedSize);
-      if (!readBuffer)
-        {
-          result = ZIP_ERR_OUT_OF_MEMORY;
-          goto finished;
-        }
-      if (zipFile->pointer != entry->dataPointer)
-        {
-          seekResult =
-            hyfile_seek (zipFile->fd, entry->dataPointer, HySeekSet);
-          if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-            {
-              zipFile->pointer = -1;
-              zdatafree (&wb, readBuffer);
-              result = ZIP_ERR_FILE_READ_ERROR;
-              goto finished;
-            }
-          zipFile->pointer = (I_32) seekResult;
-
-          if (zipFile->pointer != entry->dataPointer)
-            {
-              zdatafree (&wb, readBuffer);
-              result = ZIP_ERR_FILE_READ_ERROR;
-              goto finished;
-            }
-        }
-      if (hyfile_read (zipFile->fd, readBuffer, entry->compressedSize) !=
-          (I_32) entry->compressedSize)
-        {
-          zdatafree (&wb, readBuffer);
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer += (I_32) entry->compressedSize;
-
-      /* Deflate the data. */
-      result =
-        inflateData (&wb, readBuffer, entry->compressedSize, dataBuffer,
-                     entry->uncompressedSize);
-      zdatafree (&wb, readBuffer);
-      if (result)
-        goto finished;
-      EXIT ();
-      return 0;
-    }
-
-  /* Whatever this is, we can't decompress it */
-  result = ZIP_ERR_UNSUPPORTED_FILE_TYPE;
-
-finished:
-  if (!buffer)
-    {
-      entry->data = NULL;
-      zdatafree (&wb, dataBuffer);
-    }
-  if (result == ZIP_ERR_FILE_READ_ERROR)
-    {
-      zipFile->pointer = -1;
-    }
-  EXIT ();
-  return result;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntryExtraField
-/** 
- *	Read the extra field of entry from the zip file filename. 
- *
- * buffer is used if non-NULL, but is not held onto by entry. 
- *
- * If buffer is NULL, memory is allocated and held onto by entry, and MUST be freed later with
- *	@ref zip_freeZipEntry.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile the zip file being read from.
- * @param[in,out] entry the zip entry concerned
- * @param[in] buffer may or may not be NULL
- * @param[in] bufferSize
- *
- * @return 0 on success or one of the following:
- * @return ZIP_ERR_FILE_READ_ERROR if there is an error reading from zipFile
- * @return 	ZIP_ERR_FILE_CORRUPT if zipFile is corrupt
- * @return 	ZIP_ERR_OUT_OF_MEMORY if there is not enough memory to complete this call
- * @return 	ZIP_ERR_BUFFER_TOO_SMALL if the buffer was non-Null but not large enough to hold the contents of entry
- *
- * @see zip_freeZipEntry
-*/
-I_32
-zip_getZipEntryExtraField (HyPortLibrary * portLib, HyZipFile * zipFile,
-                           HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-
-  I_32 result;
-  U_8 *extraFieldBuffer;
-  I_64 seekResult;
-
-  ENTER ();
-
-  if (entry->extraFieldLength == 0)
-    {
-      EXIT ();
-      return 0;
-    }
-
-  if (buffer)
-    {
-      if (bufferSize < entry->extraFieldLength)
-        {
-          EXIT ();
-          return ZIP_ERR_BUFFER_TOO_SMALL;
-        }
-      extraFieldBuffer = buffer;
-    }
-  else
-    {
-      extraFieldBuffer = hymem_allocate_memory (entry->extraFieldLength);
-      if (!extraFieldBuffer)
-        {
-          EXIT ();
-          return ZIP_ERR_OUT_OF_MEMORY;
-        }
-      entry->extraField = extraFieldBuffer;
-    }
-
-  if (zipFile->pointer != entry->extraFieldPointer)
-    {
-      seekResult =
-        hyfile_seek (zipFile->fd, entry->extraFieldPointer, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer = (I_32) seekResult;
-      if (zipFile->pointer != entry->extraFieldPointer)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-    }
-  result =
-    hyfile_read (zipFile->fd, extraFieldBuffer, entry->extraFieldLength);
-  if (result != (I_32) entry->extraFieldLength)
-    {
-      result = ZIP_ERR_FILE_READ_ERROR;
-      goto finished;
-    }
-  zipFile->pointer += result;
-  EXIT ();
-  return 0;
-
-finished:
-  if (!buffer)
-    {
-      entry->extraField = NULL;
-      hymem_free_memory (extraFieldBuffer);
-    }
-  if (result == ZIP_ERR_FILE_READ_ERROR)
-    zipFile->pointer = -1;
-  EXIT ();
-  return result;
-
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntryFilename
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntryComment
-/**
- *	Read the file comment for entry. 
- *
- * If buffer is non-NULL, it is used, but not held onto by entry. 
- *
- * If buffer is NULL, memory is allocated and
- *	held onto by entry, and thus should later be freed with @ref zip_freeZipEntry.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile the zip file concerned
- * @param[in] entry the entry who's comment we want
- * @param[in] buffer may or may not be NULL
- * @param[in] bufferSize
-
- * @return 0 on success or one of the following
- * @return	ZIP_ERR_FILE_READ_ERROR if there is an error reading the file comment from zipEntry
- * @return	ZIP_ERR_FILE_CORRUPT if zipFile is corrupt
- * @return	ZIP_ERR_ENTRY_NOT_FOUND if entry is not found
- * @return 	ZIP_ERR_OUT_OF_MEMORY  if there is not enough memory to complete this call
- * @return 	ZIP_ERR_BUFFER_TOO_SMALL if buffer is too small to hold the comment for zipFile
-*/
-
-I_32
-zip_getZipEntryComment (HyPortLibrary * portLib, HyZipFile * zipFile,
-                        HyZipEntry * entry, U_8 * buffer, U_32 bufferSize)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-
-  I_32 result;
-  U_8 *fileCommentBuffer;
-  I_64 seekResult;
-
-  ENTER ();
-
-  if (entry->fileCommentLength == 0)
-    {
-      if (entry->fileCommentPointer == -1)
-        {
-          /* TODO: we don't know where the comment is (or even if there is one)! This only happens if you're running
-             without a cache, so too bad for now */
-        }
-      EXIT ();
-      return 0;
-    }
-
-  if (buffer)
-    {
-      if (bufferSize < entry->fileCommentLength)
-        {
-          EXIT ();
-          return ZIP_ERR_BUFFER_TOO_SMALL;
-        }
-      fileCommentBuffer = buffer;
-    }
-  else
-    {
-      fileCommentBuffer = hymem_allocate_memory (entry->fileCommentLength);
-      if (!fileCommentBuffer)
-        {
-          EXIT ();
-          return ZIP_ERR_OUT_OF_MEMORY;
-        }
-      entry->fileComment = fileCommentBuffer;
-    }
-
-  if (zipFile->pointer != entry->fileCommentPointer)
-    {
-      seekResult =
-        hyfile_seek (zipFile->fd, entry->fileCommentPointer, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-      zipFile->pointer = (I_32) seekResult;
-
-      if (zipFile->pointer != entry->fileCommentPointer)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-    }
-  result =
-    hyfile_read (zipFile->fd, fileCommentBuffer, entry->fileCommentLength);
-  if (result != (I_32) entry->fileCommentLength)
-    {
-      result = ZIP_ERR_FILE_READ_ERROR;
-      goto finished;
-    }
-  zipFile->pointer += result;
-  EXIT ();
-  return 0;
-
-finished:
-  if (!buffer)
-    {
-      entry->fileComment = NULL;
-      hymem_free_memory (fileCommentBuffer);
-    }
-  if (result == ZIP_ERR_FILE_READ_ERROR)
-    {
-      zipFile->pointer = -1;
-    }
-  EXIT ();
-  return result;
-
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_openZipFile
-/**
- * Attempt to open a zip file. 
- * 
- * If the cache pool is non-NULL, the cachePool will be used to find a suitable cache, and if none can be found it will create one and add it to cachePool.
- * Zip support is responsible for managing the lifetime of the cache.  
- *
- * @note If cachePool is NULL, zipFile will be opened without a cache.
- *
- * @param[in] portLib the port library
- * @param[in] filename the zip file to open
- * @param[out] zipFile the zip file structure to populate
- * @param[in] cachePool the cache pool
- * 
- * @return 0 on success
- * @return 	ZIP_ERR_FILE_OPEN_ERROR if is there is an error opening the file
- * @return	ZIP_ERR_FILE_READ_ERROR if there is an error reading the file
- * @return	ZIP_ERR_FILE_CORRUPT if the file is corrupt
- * @return	ZIP_ERR_UNKNOWN_FILE_TYPE if the file type is not known
- * @return	ZIP_ERR_UNSUPPORTED_FILE_TYPE if the file type is unsupported
- * @return	ZIP_ERR_OUT_OF_MEMORY if we are out of memory
-*/
-I_32
-zip_openZipFile (HyPortLibrary * portLib, char *filename, HyZipFile * zipFile,
-                 HyZipCachePool * cachePool)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-
-  IDATA fd = -1;
-  I_32 result = 0;
-  I_64 seekResult;
-  U_8 buffer[4];
-  I_32 len;
-
-  ENTER ();
-
-  len = strlen (filename);
-  zipFile->fd = -1;
-  zipFile->type = ZIP_Unknown;
-  zipFile->cache = NULL;
-  zipFile->cachePool = NULL;
-  zipFile->pointer = -1;
-  /* Allocate space for filename */
-  if (len >= ZIP_INTERNAL_MAX)
-    {
-      zipFile->filename = hymem_allocate_memory (len + 1);
-      if (!zipFile->filename)
-        {
-          EXIT ();
-          return ZIP_ERR_OUT_OF_MEMORY;
-        }
-    }
-  else
-    {
-      zipFile->filename = zipFile->internalFilename;
-    }
-
-  strcpy ((char *) zipFile->filename, filename);
-
-  fd = hyfile_open (filename, HyOpenRead, 0);
-  if (fd == -1)
-    {
-      result = ZIP_ERR_FILE_OPEN_ERROR;
-      goto finished;
-    }
-
-  if (hyfile_read (fd, buffer, 4) != 4)
-    {
-      result = ZIP_ERR_FILE_READ_ERROR;
-      goto finished;
-    }
-
-  if ((buffer[0] == 'P') && (buffer[1] == 'K'))
-    {
-      /* If not the central header or local file header, its corrupt */
-      if (!
-          ((buffer[2] == 1 && buffer[3] == 2)
-           || (buffer[2] == 3 && buffer[3] == 4)))
-        {
-          result = ZIP_ERR_FILE_CORRUPT;
-          goto finished;
-        }
-      /* PKZIP file. Back up the pointer to the beginning. */
-      seekResult = hyfile_seek (fd, 0, HySeekSet);
-      if (seekResult != 0)
-        {
-          result = ZIP_ERR_FILE_READ_ERROR;
-          goto finished;
-        }
-
-      zipFile->fd = fd;
-      zipFile->type = ZIP_PKZIP;
-      zipFile->pointer = 0;
-    }
-
-  if ((buffer[0] == 0x1F) && (buffer[1] == 0x8B))
-    {
-      /* GZIP - currently unsupported. 
-         zipFile->fd = fd;
-         zipFile->type = ZIP_GZIP;
-         zipFile->pointer = 2;
-       */
-      result = ZIP_ERR_UNSUPPORTED_FILE_TYPE;
-      goto finished;
-    }
-
-  if (zipFile->type == ZIP_Unknown)
-    {
-      result = ZIP_ERR_UNKNOWN_FILE_TYPE;
-      goto finished;
-    }
-
-  result = 0;
-
-  if (cachePool)
-    {
-      zipFile->cachePool = cachePool;
-      result = zip_establishCache (portLib, zipFile);
-    }
-
-finished:
-  if (result == 0)
-    {
-      zipFile->fd = fd;
-      EXIT ();
-      return 0;
-    }
-  if (fd != -1)
-    {
-      hyfile_close (fd);
-    }
-  if ((zipFile->filename) && (zipFile->filename != zipFile->internalFilename))
-    {
-      hymem_free_memory (zipFile->filename);
-    }
-  zipFile->filename = NULL;
-  EXIT ();
-  return result;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_resetZipFile
-/**
- * Reset nextEntryPointer to the first entry in the file.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile the zip being read from
- * @param[out] nextEntryPointer will be reset to the first entry in the file
- *
- * @return none
- *
- * 
-*/
-void
-zip_resetZipFile (HyPortLibrary * portLib, HyZipFile * zipFile,
-                  IDATA * nextEntryPointer)
-{
-  *nextEntryPointer = 0;
-  if (zipFile)
-    {
-      if (zipFile->cache)
-        *nextEntryPointer = zipFile->cache->startCentralDir;
-      else
-        {
-          I_32 result;
-          HyZipCentralEnd endEntry;
-          result = scanForCentralEnd (portLib, zipFile, &endEntry);
-          if (result != 0)
-            return;
-          *nextEntryPointer = (IDATA) ((UDATA) endEntry.dirOffset);
-        }
-    }
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zip_getZipEntryFromOffset
-/**
- * Attempt to read a zip entry at offset from the zip file provided.
- *	If found, read into entry.
- *
- * @note If an uncached entry is found, the filename field will be filled in. This
- *	memory MUST be freed with @ref zip_freeZipEntry.
- *
- * @param[in] portLib the port library
- * @param[in] zipFile the zip file being read
- * @param[in] offset the offset into the zipFile of the desired zip entry
- * @param[out] entry the compressed data
- *
- * @return 0 on success
- * @return ZIP_ERR_FILE_READ_ERROR if there is an error reading from @ref zipFile
- * @return 	ZIP_ERR_FILE_CORRUPT if @ref zipFile is corrupt
- * @return 	ZIP_ERR_ENTRY_NOT_FOUND if the entry is not found 
- * @return 	ZIP_ERR_OUT_OF_MEMORY if there is not enough memory to complete this call
- *
- * @see zip_freeZipEntry
-*/
-I_32
-zip_getZipEntryFromOffset (HyPortLibrary * portLib, HyZipFile * zipFile,
-                           HyZipEntry * entry, IDATA offset)
-{
-  PORT_ACCESS_FROM_PORT (portLib);
-#if defined(HY_NO_THR)
-  THREAD_ACCESS_FROM_PORT(portLib);
-#endif /* HY_NO_THR */
-  I_32 result;
-  I_64 seekResult;
-
-  ENTER ();
-
-  if (zipFile->pointer != offset)
-    {
-      seekResult = hyfile_seek (zipFile->fd, offset, HySeekSet);
-      if ((seekResult < 0) || (seekResult > HYCONST64 (0x7FFFFFFF)))
-        {
-          zipFile->pointer = -1;
-          EXIT ();
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-      zipFile->pointer = (I_32) seekResult;
-      if (zipFile->pointer != offset)
-        {
-          zipFile->pointer = -1;
-          EXIT ();
-          return ZIP_ERR_FILE_READ_ERROR;
-        }
-    }
-
-  result = readZipEntry (portLib, zipFile, entry, NULL, NULL, NULL, FALSE);
-  EXIT ();
-  return result;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zdataalloc
-/*
-	cached alloc management for zip_getZipEntryData.
-*/
-void *
-zdataalloc (void *opaque, U_32 items, U_32 size)
-{
-  UDATA *returnVal = 0;
-  U_32 byteSize = items * size;
-  U_32 allocSize = WORK_BUFFER_SIZE;
-  struct workBuffer *wb = (struct workBuffer *) opaque;
-
-  PORT_ACCESS_FROM_PORT (wb->portLib);
-
-  /* Round to UDATA multiple */
-  byteSize = (byteSize + (sizeof (UDATA) - 1)) & ~(sizeof (UDATA) - 1);
-
-  if (wb->bufferStart == 0)
-    {
-      if (byteSize > WORK_BUFFER_SIZE)
-        {
-          allocSize = byteSize;
-        }
-      wb->bufferStart = hymem_allocate_memory (allocSize);
-      if (wb->bufferStart)
-        {
-          wb->bufferEnd = (UDATA *) ((UDATA) wb->bufferStart + allocSize);
-          wb->currentAlloc = wb->bufferStart;
-          wb->cntr = 0;
-        }
-    }
-
-  if ((wb->bufferStart == 0)
-      || (((UDATA) wb->currentAlloc + byteSize) > (UDATA) wb->bufferEnd))
-    {
-      returnVal = hymem_allocate_memory (byteSize);
-    }
-  else
-    {
-      ++(wb->cntr);
-      returnVal = wb->currentAlloc;
-      wb->currentAlloc = (UDATA *) ((UDATA) wb->currentAlloc + byteSize);
-    }
-  return returnVal;
-}
-
-#undef CDEV_CURRENT_FUNCTION
-
-#define CDEV_CURRENT_FUNCTION zdatafree
-/*
-	cached alloc management for zip_getZipEntryData.
-*/
-void
-zdatafree (void *opaque, void *address)
-{
-  struct workBuffer *wb = (struct workBuffer *) opaque;
-
-  PORT_ACCESS_FROM_PORT (wb->portLib);
-
-  if ((address < (void *) wb->bufferStart)
-      || (address >= (void *) wb->bufferEnd))
-    {
-      hymem_free_memory (address);
-    }
-  else if (--(wb->cntr) == 0)
-    {
-      hymem_free_memory (wb->bufferStart);
-      wb->bufferStart = wb->bufferEnd = wb->currentAlloc = 0;
-    }
-
-}
-
-#undef CDEV_CURRENT_FUNCTION
diff --git a/libcore/archive/src/main/native/zipsup.h b/libcore/archive/src/main/native/zipsup.h
deleted file mode 100644
index 67a2eda..0000000
--- a/libcore/archive/src/main/native/zipsup.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* Zip Support Header
-*/
-
-#if !defined(ZIPSUP_H)
-#define ZIPSUP_H
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-#include "hy2sie.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <memory.h>
-
-#include "zlib.h"
-
-
-typedef struct HyZipCachePool HyZipCachePool;
-
-HyZipCachePool *
-zipsup_GetZipCachePool(HyPortLibrary * portLib);
-
-
-#if defined(HY_LOCAL_ZLIB)
-#define HY_ZIP_DLL_NAME "z"
-#else
-#define HY_ZIP_DLL_NAME "hyzlib"
-#endif
-
-#define ZIP_INTERNAL_MAX  80
-#define ZIP_CM_Reduced1  2
-#define ZIP_Unknown  0
-#define ZIP_GZIP  2
-#define ZIP_ERR_OUT_OF_MEMORY  -3
-#define ZIP_ERR_FILE_CORRUPT  -6
-#define ZIP_ERR_INTERNAL_ERROR  -11
-#define ZIP_CM_Imploded  6
-#define ZIP_CM_Reduced4  5
-#define ZIP_CM_Shrunk  1
-#define ZIP_CM_Reduced2  3
-#define ZIP_ERR_FILE_READ_ERROR  -1
-#define ZIP_CentralHeader  0x2014B50
-#define ZIP_ERR_FILE_CLOSE_ERROR  -10
-#define ZIP_ERR_BUFFER_TOO_SMALL  -7
-#define ZIP_CM_Reduced3  4
-#define ZIP_CM_Deflated  8
-#define ZIP_LocalHeader  0x4034B50
-#define ZIP_CM_Tokenized  7
-#define ZIP_PKZIP  1
-#define ZIP_CM_Stored  0
-#define ZIP_ERR_UNSUPPORTED_FILE_TYPE  -5
-#define ZIP_ERR_NO_MORE_ENTRIES  -2
-#define ZIP_CentralEnd  0x6054B50
-#define ZIP_ERR_FILE_OPEN_ERROR  -9
-#define ZIP_ERR_UNKNOWN_FILE_TYPE  -4
-#define ZIP_ERR_ENTRY_NOT_FOUND  -8
-#define ZIP_DataDescriptor  0x8074B50
-
-  typedef struct HyZipCache
-  {
-    U_8 *zipFileName;
-    IDATA zipFileSize;
-    I_64 zipTimeStamp;
-    IDATA startCentralDir;
-    HyPortLibrary *portLib;
-    void *cachePool;
-    void *cachePoolEntry;
-  } HyZipCache;
-
-
-  typedef struct HyZipCentralEnd
-  {
-    U_16 diskNumber;
-    U_16 dirStartDisk;
-    U_16 thisDiskEntries;
-    U_16 totalEntries;
-    U_32 dirSize;
-    U_32 dirOffset;
-    U_16 commentLength;
-    char _hypadding0012[2];   /* 2 bytes of automatic padding */
-    U_8 *comment;
-  } HyZipCentralEnd;
-
-
-  typedef struct HyZipDataDescriptor
-  {
-    U_32 crc32;
-    U_32 compressedSize;
-    U_32 uncompressedSize;
-  } HyZipDataDescriptor;
-
-
-  typedef struct HyZipEntry
-  {
-    U_8 *data;
-    U_8 *filename;
-    U_8 *extraField;
-    U_8 *fileComment;
-    I_32 dataPointer;
-    I_32 filenamePointer;
-    I_32 extraFieldPointer;
-    I_32 fileCommentPointer;
-    U_32 compressedSize;
-    U_32 uncompressedSize;
-    U_32 crc32;
-    U_16 filenameLength;
-    U_16 extraFieldLength;
-    U_16 fileCommentLength;
-    U_16 internalAttributes;
-    U_16 versionCreated;
-    U_16 versionNeeded;
-    U_16 flags;
-    U_16 compressionMethod;
-    U_16 lastModTime;
-    U_16 lastModDate;
-    U_8 internalFilename[80];
-  } HyZipEntry;
-
-
-  typedef struct HyZipFile
-  {
-    U_8 *filename;
-    struct HyZipCache *cache;
-    void *cachePool;
-    I_32 fd;
-    I_32 pointer;
-    U_8 internalFilename[80];
-    U_8 type;
-    char _hypadding0065[3];  /* 3 bytes of automatic padding */
-  } HyZipFile;
-
-
-
-#include "hymutex.h"
-extern MUTEX zip_GlobalMutex;
-
-
-
-#define jclmem_allocate_memory(env, byteCount) sieb_malloc(env, byteCount)
-#define jclmem_free_memory(env, pointer) sieb_free(env, pointer)
-
-
-/* HySourceZipSupport*/
-  extern HY_CFUNC I_32 zip_getZipEntryData
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
-  extern HY_CFUNC I_32 zip_getZipEntryFromOffset
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * entry, IDATA offset));
-  extern HY_CFUNC I_32 zip_establishCache
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile));
-  extern HY_CFUNC void zip_resetZipFile
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                IDATA * nextEntryPointer));
-  extern HY_CFUNC I_32 zip_getNextZipEntry
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * zipEntry, IDATA * nextEntryPointer));
-  extern HY_CFUNC I_32 zip_getZipEntry
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * entry, const char *filename,
-                BOOLEAN findDirectory));
-  extern HY_CFUNC I_32 zip_getZipEntryExtraField
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
-  extern HY_CFUNC void zip_initZipEntry
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
-  extern HY_CFUNC I_32 zip_openZipFile
-    PROTOTYPE ((HyPortLibrary * portLib, char *filename, HyZipFile * zipFile,
-                HyZipCachePool * cachePool));
-  extern HY_CFUNC void zip_freeZipEntry
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipEntry * entry));
-  struct HyZipFile;
-  extern HY_CFUNC I_32 VMCALL zip_closeZipFile
-    PROTOTYPE ((HyPortLibrary * portLib, struct HyZipFile * zipFile));
-  extern HY_CFUNC I_32 zip_getZipEntryComment
-    PROTOTYPE ((HyPortLibrary * portLib, HyZipFile * zipFile,
-                HyZipEntry * entry, U_8 * buffer, U_32 bufferSize));
-/* HySourceZipCache*/
-  extern HY_CFUNC UDATA zipCache_findElement
-    PROTOTYPE ((HyZipCache * zipCache, const char *elementName,
-                BOOLEAN searchDirList));
-  extern HY_CFUNC void zipCache_kill PROTOTYPE ((HyZipCache * zipCache));
-  extern HY_CFUNC IDATA zipCache_enumGetDirName
-    PROTOTYPE ((void *handle, char *nameBuf, UDATA nameBufSize));
-  extern HY_CFUNC HyZipCache *zipCache_new
-    PROTOTYPE ((HyPortLibrary * portLib, char *zipName, IDATA zipNameLength));
-  extern HY_CFUNC IDATA zipCache_enumNew
-    PROTOTYPE ((HyZipCache * zipCache, char *directoryName, void **handle));
-  extern HY_CFUNC IDATA zipCache_enumElement
-    PROTOTYPE ((void *handle, char *nameBuf, UDATA nameBufSize,
-                UDATA * offset));
-  extern HY_CFUNC void zipCache_enumKill PROTOTYPE ((void *handle));
-  extern HY_CFUNC BOOLEAN zipCache_addElement
-    PROTOTYPE ((HyZipCache * zipCache, char *elementName,
-                UDATA elementOffset));
-/* HySourceZipCachePool*/
-  extern HY_CFUNC BOOLEAN zipCachePool_release
-    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
-  extern HY_CFUNC void zipCachePool_kill PROTOTYPE ((HyZipCachePool * zcp));
-  extern HY_CFUNC HyZipCache *zipCachePool_findCache
-    PROTOTYPE ((HyZipCachePool * zcp, char const *zipFileName,
-                IDATA zipFileNameLength, IDATA zipFileSize,
-                I_64 zipTimeStamp));
-  extern HY_CFUNC HyZipCachePool *zipCachePool_new
-    PROTOTYPE ((HyPortLibrary * portLib));
-  extern HY_CFUNC BOOLEAN zipCachePool_addCache
-    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
-  extern HY_CFUNC BOOLEAN zipCachePool_addRef
-    PROTOTYPE ((HyZipCachePool * zcp, HyZipCache * zipCache));
-#if defined(__cplusplus)
-}
-#endif
-#endif /* ZIPSUP_H */
diff --git a/libcore/archive/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java b/libcore/archive/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java
deleted file mode 100644
index 7e1c4bd..0000000
--- a/libcore/archive/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.archive.util;
-
-import junit.framework.TestCase;
-
-public class UtilTest extends TestCase {
-    private static final String ASCII_ALPHABET_LC = "abcdefghijklmnopqrstuvwxyz";
-    private static final String ASCII_ALPHABET_UC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-    private static final byte[] ASCII_ALPHABET_LC_BYTES;
-    private static final byte[] ASCII_ALPHABET_UC_BYTES;
-
-    static {
-        ASCII_ALPHABET_LC_BYTES = new byte[ASCII_ALPHABET_LC.length()];
-        for (int i = 0; i < ASCII_ALPHABET_LC_BYTES.length; i++) {
-            final char c = ASCII_ALPHABET_LC.charAt(i);
-            final byte b = (byte) c;
-            assert ((char) b) == c;
-            ASCII_ALPHABET_LC_BYTES[i] = b;
-        }
-
-        ASCII_ALPHABET_UC_BYTES = new byte[ASCII_ALPHABET_UC.length()];
-        for (int i = 0; i < ASCII_ALPHABET_UC_BYTES.length; i++) {
-            final char c = ASCII_ALPHABET_UC.charAt(i);
-            final byte b = (byte) c;
-            assert ((char) b) == c;
-            ASCII_ALPHABET_UC_BYTES[i] = b;
-        }
-    }
-
-    public void testasciiEndsWithIgnoreCase() {
-        final String s1 = ASCII_ALPHABET_LC;
-        final String s2 = ASCII_ALPHABET_UC;
-        assertTrue(Util.asciiEndsWithIgnoreCase(s1, s2));
-        assertTrue(Util.asciiEndsWithIgnoreCase(s2, s1));
-        assertTrue(Util.asciiEndsWithIgnoreCase(s1, "wxyz"));
-    }
-
-    public void testasciiEqualsIgnoreCase() {
-        final String s1 = ASCII_ALPHABET_LC;
-        final String s2 = ASCII_ALPHABET_UC;
-        assertTrue(Util.asciiEqualsIgnoreCase(s1, s2));
-        assertTrue(Util.asciiEqualsIgnoreCase(s2, s1));
-    }
-
-    public void testEqualsIgnoreCaseByteArrayByteArray() {
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_LC_BYTES,
-                ASCII_ALPHABET_LC_BYTES));
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_LC_BYTES,
-                ASCII_ALPHABET_UC_BYTES));
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_UC_BYTES,
-                ASCII_ALPHABET_UC_BYTES));
-    }
-
-}
diff --git a/libcore/archive/src/test/java/java/util/zip/AllTests.java b/libcore/archive/src/test/java/java/util/zip/AllTests.java
deleted file mode 100644
index df1d8de..0000000
--- a/libcore/archive/src/test/java/java/util/zip/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-        suite.addTestSuite(DeflaterOutputStreamTest.class);
-        suite.addTestSuite(DeflaterTest.class);
-        return suite;
-    }
-}
diff --git a/libcore/archive/src/test/java/java/util/zip/DeflaterOutputStreamTest.java b/libcore/archive/src/test/java/java/util/zip/DeflaterOutputStreamTest.java
deleted file mode 100644
index 5d155fe..0000000
--- a/libcore/archive/src/test/java/java/util/zip/DeflaterOutputStreamTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import junit.framework.TestCase;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class DeflaterOutputStreamTest extends TestCase {
-
-    public void testSyncFlushEnabled() throws Exception {
-        InflaterInputStream in = createInflaterStream(true);
-        assertEquals(1, in.read());
-        assertEquals(2, in.read());
-        assertEquals(3, in.read());
-    }
-
-    public void testSyncFlushDisabled() throws Exception {
-        InflaterInputStream in = createInflaterStream(false);
-        try {
-            in.read();
-            fail();
-        } catch (IOException expected) {
-        }
-    }
-
-    /**
-     * Creates an optionally-flushing deflater stream, writes some bytes to it,
-     * and flushes it. Returns an inflater stream that reads this deflater's
-     * output.
-     *
-     * <p>These bytes are written on a separate thread so that when the inflater
-     * stream is read, that read will fail when no bytes are available. Failing
-     * takes 3 seconds, co-ordinated by PipedInputStream's 'broken pipe'
-     * timeout. The 3 second delay is unfortunate but seems to be the easiest
-     * way demonstrate that data is unavailable. Ie. other techniques will cause
-     * the dry read to block indefinitely.
-     */
-    private InflaterInputStream createInflaterStream(final boolean flushing)
-            throws Exception {
-        ExecutorService executor = Executors.newSingleThreadExecutor();
-        final PipedOutputStream pout = new PipedOutputStream();
-        PipedInputStream pin = new PipedInputStream(pout);
-
-        executor.submit(new Callable<Void>() {
-            public Void call() throws Exception {
-                OutputStream out = new DeflaterOutputStream(pout, flushing);
-                out.write(1);
-                out.write(2);
-                out.write(3);
-                out.flush();
-                return null;
-            }
-        }).get();
-        executor.shutdown();
-
-        return new InflaterInputStream(pin);
-    }
-}
diff --git a/libcore/archive/src/test/java/java/util/zip/DeflaterTest.java b/libcore/archive/src/test/java/java/util/zip/DeflaterTest.java
deleted file mode 100644
index d8ce66e..0000000
--- a/libcore/archive/src/test/java/java/util/zip/DeflaterTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util.zip;
-
-import junit.framework.TestCase;
-
-public class DeflaterTest extends TestCase {
-
-    private byte[] compressed = new byte[32];
-    private byte[] decompressed = new byte[20];
-    private Deflater deflater = new Deflater();
-    private Inflater inflater = new Inflater();
-    private int totalDeflated = 0;
-    private int totalInflated = 0;
-
-    public void testDeflate() throws DataFormatException {
-        deflater.setInput(new byte[] { 1, 2, 3 });
-        deflateInflate(Deflater.NO_FLUSH);
-        assertTrue(totalInflated < 3);
-        assertEquals(0, decompressed[2]); // the 3rd byte shouldn't have been flushed yet
-
-        deflater.setInput(new byte[] { 4, 5, 6 });
-        deflateInflate(Deflater.SYNC_FLUSH);
-        assertEquals(6, totalInflated);
-        assertDecompressed(1, 2, 3, 4, 5, 6);
-        assertEquals(0, inflater.inflate(decompressed));
-
-        deflater.setInput(new byte[] { 7, 8, 9 });
-        deflateInflate(Deflater.FULL_FLUSH);
-        assertEquals(9, totalInflated);
-        assertDecompressed(1, 2, 3, 4, 5, 6, 7, 8, 9);
-        assertEquals(0, inflater.inflate(decompressed));
-        inflater = new Inflater(true); // safe because we did a FULL_FLUSH
-
-        deflater.setInput(new byte[] { 10, 11, 12 });
-        deflateInflate(Deflater.SYNC_FLUSH);
-        assertEquals(12, totalInflated);
-        assertDecompressed(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
-        assertEquals(0, inflater.inflate(decompressed));
-    }
-
-    private void deflateInflate(int flush) throws DataFormatException {
-        int lastDeflated = deflater.deflate(compressed, totalDeflated,
-                compressed.length - totalDeflated, flush);
-        assertTrue(inflater.needsInput());
-        inflater.setInput(compressed, totalDeflated, lastDeflated);
-        totalDeflated += lastDeflated;
-        totalInflated += inflater.inflate(decompressed, totalInflated,
-                decompressed.length - totalInflated);
-    }
-
-    private void assertDecompressed(int... expected) {
-        for (int i = 0; i < decompressed.length; i++) {
-            int expectedValue = i < expected.length ? expected[i] : 0;
-            assertEquals(expectedValue, decompressed[i]);
-        }
-    }
-}
diff --git a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AllTests.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AllTests.java
deleted file mode 100644
index 13fe019..0000000
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AllTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.tests.java.util.jar;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for java.util.jar package.
- */
-public class AllTests {
-
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(suite());
-    }
-
-    public static Test suite() {
-        TestSuite suite = tests.TestSuiteFactory.createTestSuite(
-                "Suite org.apache.harmony.archive.tests.java.util.jar");
-        suite.addTestSuite(AttributesNameTest.class);
-        suite.addTestSuite(AttributesTest.class);
-        suite.addTestSuite(JarEntryTest.class);
-        suite.addTestSuite(JarExceptionTest.class);
-        suite.addTestSuite(JarExecTest.class);
-        suite.addTestSuite(JarFileTest.class);
-        suite.addTestSuite(JarInputStreamTest.class);
-        suite.addTestSuite(JarOutputStreamTest.class);
-        suite.addTestSuite(ManifestTest.class);
-        suite.addTestSuite(Pack200Test.class);
-        suite.addTestSuite(Pack200PackerTest.class);
-        suite.addTestSuite(Pack200UnpackerTest.class);
-        suite.addTestSuite(ZipExecTest.class);
-        return suite;
-    }
-}
diff --git a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java
deleted file mode 100644
index 067bf49..0000000
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesNameTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.tests.java.util.jar;
-
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
-import java.util.jar.Attributes;
-import junit.framework.TestCase;
-
-@TestTargetClass(Attributes.Name.class)
-public class AttributesNameTest extends TestCase {
-
-    /**
-     * @tests java.util.jar.Attributes.Name#Name(java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Name",
-        args = {java.lang.String.class}
-    )
-    public void test_AttributesName_Constructor() {
-        // Regression for HARMONY-85
-        try {
-            new Attributes.Name(
-                    "01234567890123456789012345678901234567890123456789012345678901234567890");
-            fail("Assert 0: should have thrown IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // expected
-        }
-
-        try {
-            new Attributes.Name((String) null);
-            fail("NullPointerException expected");
-        } catch (NullPointerException ee) {
-            // expected
-        }
-
-        assertNotNull(new Attributes.Name("Attr"));
-    }
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
-    public void test_equalsLjava_lang_Object() {
-        Attributes.Name attr1 = new Attributes.Name("Attr");
-        Attributes.Name attr2 = new Attributes.Name("Attr");
-
-        assertTrue(attr1.equals(attr2));
-        attr2 = new Attributes.Name("Attr1");
-        assertFalse(attr1.equals(attr2));
-    }
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
-    public void test_hashCode() {
-        Attributes.Name attr1 = new Attributes.Name("Attr1");
-        Attributes.Name attr2 = new Attributes.Name("Attr2");
-
-        assertNotSame(attr1.hashCode(), attr2.hashCode());
-    }
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
-    public void test_toString() {
-        String str1 = "Attr1";
-        String str2 = "Attr2";
-        Attributes.Name attr1 = new Attributes.Name(str1);
-        Attributes.Name attr2 = new Attributes.Name("Attr2");
-
-        assertTrue(attr1.toString().equals(str1));
-        assertTrue(attr2.toString().equals(str2));
-        assertFalse(attr2.toString().equals(str1));
-    }
-}
diff --git a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java b/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
deleted file mode 100644
index 0b3d2cf..0000000
--- a/libcore/archive/src/test/java/org/apache/harmony/archive/tests/java/util/jar/AttributesTest.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.tests.java.util.jar;
-
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.Attributes;
-import junit.framework.TestCase;
-
-@TestTargetClass(Attributes.class)
-public class AttributesTest extends TestCase {
-    private Attributes a;
-
-    @Override
-    protected void setUp() {
-        a = new Attributes();
-        a.putValue("1", "one");
-        a.putValue("2", "two");
-        a.putValue("3", "three");
-        a.putValue("4", "four");
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#Attributes(java.util.jar.Attributes)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Attributes",
-        args = {java.util.jar.Attributes.class}
-    )
-    public void test_ConstructorLjava_util_jar_Attributes() {
-        Attributes a2 = new Attributes(a);
-        assertEquals(a, a2);
-        a.putValue("1", "one(1)");
-        assertTrue("equal", !a.equals(a2));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#clear()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
-    public void test_clear() {
-        a.clear();
-        assertNull("a) All entries should be null after clear", a.get("1"));
-        assertNull("b) All entries should be null after clear", a.get("2"));
-        assertNull("c) All entries should be null after clear", a.get("3"));
-        assertNull("d) All entries should be null after clear", a.get("4"));
-        assertTrue("Should not contain any keys", !a.containsKey("1"));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#containsKey(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
-    public void test_containsKeyLjava_lang_Object() {
-        assertTrue("a) Should have returned false", !a.containsKey(new Integer(
-                1)));
-        assertTrue("b) Should have returned false", !a.containsKey("0"));
-        assertTrue("Should have returned true", a
-                .containsKey(new Attributes.Name("1")));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#containsValue(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
-    public void test_containsValueLjava_lang_Object() {
-        assertTrue("Should have returned false", !a.containsValue("One"));
-        assertTrue("Should have returned true", a.containsValue("one"));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#entrySet()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
-    public void test_entrySet() {
-        Set<Map.Entry<Object, Object>> entrySet = a.entrySet();
-        Set<Object> keySet = new HashSet<Object>();
-        Set<Object> valueSet = new HashSet<Object>();
-        Iterator<?> i;
-        assertEquals(4, entrySet.size());
-        i = entrySet.iterator();
-        while (i.hasNext()) {
-            java.util.Map.Entry<?, ?> e;
-            e = (Map.Entry<?, ?>) i.next();
-            keySet.add(e.getKey());
-            valueSet.add(e.getValue());
-        }
-        assertTrue("a) Should contain entry", valueSet.contains("one"));
-        assertTrue("b) Should contain entry", valueSet.contains("two"));
-        assertTrue("c) Should contain entry", valueSet.contains("three"));
-        assertTrue("d) Should contain entry", valueSet.contains("four"));
-        assertTrue("a) Should contain key", keySet
-                .contains(new Attributes.Name("1")));
-        assertTrue("b) Should contain key", keySet
-                .contains(new Attributes.Name("2")));
-        assertTrue("c) Should contain key", keySet
-                .contains(new Attributes.Name("3")));
-        assertTrue("d) Should contain key", keySet
-                .contains(new Attributes.Name("4")));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#get(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getValue",
-        args = {java.lang.String.class}
-    )
-    public void test_getLjava_lang_Object() {
-        assertEquals("a) Incorrect value returned", "one", a.getValue("1"));
-        assertNull("b) Incorrect value returned", a.getValue("0"));
-
-        try {
-            a.getValue("IllegalArgumentException expected");
-        } catch (IllegalArgumentException ee) {
-            // expected
-        }
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#isEmpty()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
-    public void test_isEmpty() {
-        assertTrue("Should not be empty", !a.isEmpty());
-        a.clear();
-        assertTrue("a) Should be empty", a.isEmpty());
-        a = new Attributes();
-        assertTrue("b) Should be empty", a.isEmpty());
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#keySet()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
-    public void test_keySet() {
-        Set<?> s = a.keySet();
-        assertEquals(4, s.size());
-        assertTrue("a) Should contain entry", s.contains(new Attributes.Name(
-                "1")));
-        assertTrue("b) Should contain entry", s.contains(new Attributes.Name(
-                "2")));
-        assertTrue("c) Should contain entry", s.contains(new Attributes.Name(
-                "3")));
-        assertTrue("d) Should contain entry", s.contains(new Attributes.Name(
-                "4")));
-    }
-
-    /**
-     * @tests java.util.jar.Attributes#putAll(java.util.Map)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
-    public void test_putAllLjava_util_Map() {
-        Attributes b = new Attributes();
-        b.putValue("3", "san");
-        b.putValue("4", "shi");
-        b.putValue("5", "go");
-        b.putValue("6", "roku");
-        a.putAll(b);
-        assertEquals("Should not have been replaced", "one", a.getValue("1"));