/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
package sun.nio.cs.ext;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
public class IBM964
extends Charset
implements HistoricallyNamedCharset
{
public IBM964() {
super("x-IBM964", ExtendedCharsets.aliasesFor("x-IBM964"));
}
public String historicalName() {
return "Cp964";
}
public boolean contains(Charset cs) {
return (cs instanceof IBM964);
}
public CharsetDecoder newDecoder() {
return new Decoder(this);
}
public CharsetEncoder newEncoder() {
return new Encoder(this);
}
protected static class Decoder extends CharsetDecoder {
private final int SS2 = 0x8E;
private final int SS3 = 0x8F;
private String mappingTableG2;
public Decoder(Charset cs) {
super(cs, 1.0f, 1.0f);
}
private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
byte[] sa = src.array();
int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit();
assert (sp <= sl);
sp = (sp <= sl ? sp : sl);
char[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
assert (dp <= dl);
dp = (dp <= dl ? dp : dl);
try {
while (sp < sl) {
int byte1, byte2;
int inputSize = 1;
char outputChar = '\uFFFD';
byte1 = sa[sp] & 0xff;
if (byte1 == SS2) {
if (sl - sp < 4) {
return CoderResult.UNDERFLOW;
}
byte1 = sa[sp + 1] & 0xff;
inputSize = 2;
if ( byte1 == 0xa2)
mappingTableG2 = mappingTableG2a2;
else if ( byte1 == 0xac)
mappingTableG2 = mappingTableG2ac;
else if ( byte1 == 0xad)
mappingTableG2 = mappingTableG2ad;
else
return CoderResult.malformedForLength(2);
byte1 = sa[sp + 2] & 0xff;
if ( byte1 < 0xa1 || byte1 > 0xfe) {
return CoderResult.malformedForLength(3);
}
byte2 = sa[sp + 3] & 0xff;
if ( byte2 < 0xa1 || byte2 > 0xfe) {
return CoderResult.malformedForLength(4);
}
inputSize = 4;
outputChar = mappingTableG2.charAt(((byte1 - 0xa1) * 94) + byte2 - 0xa1);
} else if(byte1 == SS3 ) {
return CoderResult.malformedForLength(1);
} else if ( byte1 <= 0x9f ) { // valid single byte
outputChar = byteToCharTable.charAt(byte1);
} else if (byte1 < 0xa1 || byte1 > 0xfe) { // invalid range?
return CoderResult.malformedForLength(1);
} else { // G1
if (sl - sp < 2) {
return CoderResult.UNDERFLOW;
}
byte2 = sa[sp + 1] & 0xff;
inputSize = 2;
if ( byte2 < 0xa1 || byte2 > 0xfe) {
return CoderResult.malformedForLength(2);
}
outputChar = mappingTableG1.charAt(((byte1 - 0xa1) * 94) + byte2 - 0xa1);
}
if (outputChar == '\uFFFD')
return CoderResult.unmappableForLength(inputSize);
if (dl - dp < 1)
return CoderResult.OVERFLOW;
da[dp++] = outputChar;
sp += inputSize;
}
return CoderResult.UNDERFLOW;
} finally {
src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset());
}
}
private CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
int mark = src.position();
try {
while (src.hasRemaining()) {
int byte1, byte2;
int inputSize = 1;
char outputChar = '\uFFFD';
byte1 = src.get() & 0xff;
if (byte1 == SS2) {
if (src.remaining() < 3)
return CoderResult.UNDERFLOW;
byte1 = src.get() & 0xff;
inputSize = 2;
if ( byte1 == 0xa2)
mappingTableG2 = mappingTableG2a2;
else if ( byte1 == 0xac)
mappingTableG2 = mappingTableG2ac;
else if ( byte1 == 0xad)
mappingTableG2 = mappingTableG2ad;
else
return CoderResult.malformedForLength(2);
byte1 = src.get() & 0xff;
if ( byte1 < 0xa1 || byte1 > 0xfe)
return CoderResult.malformedForLength(3);
byte2 = src.get() & 0xff;
if ( byte2 < 0xa1 || byte2 > 0xfe)
return CoderResult.malformedForLength(4);
inputSize = 4;
outputChar = mappingTableG2.charAt(((byte1 - 0xa1) * 94) + byte2 - 0xa1);
} else if (byte1 == SS3 ) {
return CoderResult.malformedForLength(1);
} else if ( byte1 <= 0x9f ) { // valid single byte
outputChar = byteToCharTable.charAt(byte1);
} else if (byte1 < 0xa1 || byte1 > 0xfe) { // invalid range?
return CoderResult.malformedForLength(1);
} else { // G1
if (src.remaining() < 1)
return CoderResult.UNDERFLOW;
byte2 = src.get() & 0xff;
if ( byte2 < 0xa1 || byte2 > 0xfe) {
return CoderResult.malformedForLength(2);
}
inputSize = 2;
outputChar = mappingTableG1.charAt(((byte1 - 0xa1) * 94) + byte2 - 0xa1);
}
jdk-8.0.302.8-hotspot
需积分: 0 67 浏览量
更新于2022-04-07
收藏 89.79MB RAR 举报
"jdk-8.0.302.8-hotspot" 是Oracle公司发布的Java Development Kit(JDK)的一个版本,它包含了Java运行时环境(JRE)和用于开发Java应用程序的工具。这个特定的版本是8u302,意味着它是Java 8的更新302版,并且基于HotSpot虚拟机。HotSpot是Oracle JDK中的默认虚拟机,它以高性能和优化的代码执行而闻名。
中提到,这个JDK是开源的,意味着它的源代码可供公众查看、修改和分发。对于Delphi开发者来说,这个Java包文件是必不可少的,因为Delphi 11等版本支持使用Java来开发Android应用。通过Java,Delphi开发者可以利用Java的丰富库和API来扩展他们的Android应用程序功能。同时,这个JDK与Android SDK的26.1.1版本兼容,确保了在Android平台上开发的兼容性和稳定性。
中的"Java编译"指的是JDK中的javac编译器,它是将Java源代码(.java文件)转换为字节码(.class文件)的关键工具。"Delphi11"表明这个JDK版本特别适用于Embarcadero Delphi 11 IDE,使得开发者能够在Delphi环境中编写和编译Java代码。"AndroidSDK"是指用于构建Android应用的一系列工具和库,包括API级别、模拟器和构建工具。"DelphiAndroid"强调了Delphi与Android平台之间的集成。
【压缩包子文件的文件名称列表】中的目录结构反映了JDK的基本组件和库。以下是这些目录的主要内容:
1. `javax`:包含Java标准扩展API,比如JavaBeans、JAXB、JMS等。
2. `com`:通常包含第三方库或Oracle特定的类库,如JavaFX和其他Oracle提供的服务。
3. `org`:通常包含开源项目或标准组织的API,例如Apache Commons、JUnit等。
4. `jdk`:JDK的核心库,包括基本的Java类库,如`java.lang`、`java.util`、`java.io`等。
5. `java`:通常包含Java核心类库,如反射、网络、安全管理器等。
6. `launcher`:Java应用程序启动器,负责加载和启动Java虚拟机以及执行主类。
7. `sun`:Oracle特有的内部实现,包括JVM的某些部分和Java的一些早期API,可能不对外公开。
"jdk-8.0.302.8-hotspot"是Java开发和运行的基础,对于使用Delphi 11开发Android应用的程序员而言,它是不可或缺的工具集。通过这个JDK,开发者可以访问到完整的Java类库,编译Java代码,并将其部署到Android设备上,同时保证与Android SDK 26.1.1的良好兼容性。

海纳老吴
- 粉丝: 1w+
最新资源
- 系统部软件工程师工作分析问卷.doc
- 项目管理总结汇报材料..ppt
- 网络远程教育的服务质量管理.ppt
- 养老保险交换库数据上报操作要求和软件介绍.pptx
- 会计从业人员网络继续教育培训平台常见问题解答.doc
- 将autocad图形拷贝到word的完美.doc-.docx
- 物联网应用技术专业人才培养方案.docx
- 2023年大学计算机基础知识点总结.doc
- 高端科技软件开发技术分析.docx
- 物流网路架构Logistics-Network-Configuration.ppt
- 网络营销的优缺swot分析—邵阳在线.doc
- 软考网络工程师下午试卷版最新整理修订.docx
- 双流机场网络会所项目评估报告样本.docx
- 基于PowerPC的嵌入式系统设计.docx
- 2023年10月自考电子商务英语试题和答案.doc
- 电线路铁塔基础软件工程设计中的应用与分析.pptx