Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
Other Resources:
JDK 11 jdk.charsets.jmod - Charsets Module
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module.
JDK 11 Charsets module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.charsets.jmod.
JDK 11 Charsets module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Charsets module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.charsets.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/nio/cs/ext/SimpleEUCEncoder.java
/* * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ /* */ package sun.nio.cs.ext; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.nio.charset.CoderResult; import sun.nio.cs.Surrogate; public abstract class SimpleEUCEncoder extends CharsetEncoder { protected short index1[]; protected String index2; protected String index2a; protected String index2b; protected String index2c; protected int mask1; protected int mask2; protected int shift; private byte[] outputByte = new byte[4]; private final Surrogate.Parser sgp = new Surrogate.Parser(); protected SimpleEUCEncoder(Charset cs) { super(cs, 3.0f, 4.0f); } /** * Returns true if the given character can be converted to the * target character encoding. */ public boolean canEncode(char ch) { int index; String theChars; index = index1[((ch & mask1) >> shift)] + (ch & mask2); if (index < 7500) theChars = index2; else if (index < 15000) { index = index - 7500; theChars = index2a; } else if (index < 22500){ index = index - 15000; theChars = index2b; } else { index = index - 22500; theChars = index2c; } if (theChars.charAt(2*index) != '\u0000' || theChars.charAt(2*index + 1) != '\u0000') return (true); // only return true if input char was unicode null - all others are // undefined return( ch == '\u0000'); } private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) { char[] sa = src.array(); int sp = src.arrayOffset() + src.position(); int sl = src.arrayOffset() + src.limit(); assert (sp <= sl); sp = (sp <= sl ? sp : sl); byte[] da = dst.array(); int dp = dst.arrayOffset() + dst.position(); int dl = dst.arrayOffset() + dst.limit(); assert (dp <= dl); dp = (dp <= dl ? dp : dl); int index; int spaceNeeded; int i; try { while (sp < sl) { boolean allZeroes = true; char inputChar = sa[sp]; if (Character.isSurrogate(inputChar)) { if (sgp.parse(inputChar, sa, sp, sl) < 0) return sgp.error(); return sgp.unmappableResult(); } if (inputChar >= '\uFFFE') return CoderResult.unmappableForLength(1); String theChars; char aChar; // We have a valid character, get the bytes for it index = index1[((inputChar & mask1) >> shift)] + (inputChar & mask2); if (index < 7500) theChars = index2; else if (index < 15000) { index = index - 7500; theChars = index2a; } else if (index < 22500){ index = index - 15000; theChars = index2b; } else { index = index - 22500; theChars = index2c; } aChar = theChars.charAt(2*index); outputByte[0] = (byte)((aChar & 0xff00)>>8); outputByte[1] = (byte)(aChar & 0x00ff); aChar = theChars.charAt(2*index + 1); outputByte[2] = (byte)((aChar & 0xff00)>>8); outputByte[3] = (byte)(aChar & 0x00ff); for (i = 0; i < outputByte.length; i++) { if (outputByte[i] != 0x00) { allZeroes = false; break; } } if (allZeroes && inputChar != '\u0000') { return CoderResult.unmappableForLength(1); } int oindex = 0; for (spaceNeeded = outputByte.length; spaceNeeded > 1; spaceNeeded--){ if (outputByte[oindex++] != 0x00 ) break; } if (dp + spaceNeeded > dl) return CoderResult.OVERFLOW; for (i = outputByte.length - spaceNeeded; i < outputByte.length; i++) { da[dp++] = outputByte[i]; } sp++; } return CoderResult.UNDERFLOW; } finally { src.position(sp - src.arrayOffset()); dst.position(dp - dst.arrayOffset()); } } private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { int index; int spaceNeeded; int i; int mark = src.position(); try { while (src.hasRemaining()) { char inputChar = src.get(); boolean allZeroes = true; if (Character.isSurrogate(inputChar)) { if (sgp.parse(inputChar, src) < 0) return sgp.error(); return sgp.unmappableResult(); } if (inputChar >= '\uFFFE') return CoderResult.unmappableForLength(1); String theChars; char aChar; // We have a valid character, get the bytes for it index = index1[((inputChar & mask1) >> shift)] + (inputChar & mask2); if (index < 7500) theChars = index2; else if (index < 15000) { index = index - 7500; theChars = index2a; } else if (index < 22500){ index = index - 15000; theChars = index2b; } else { index = index - 22500; theChars = index2c; } aChar = theChars.charAt(2*index); outputByte[0] = (byte)((aChar & 0xff00)>>8); outputByte[1] = (byte)(aChar & 0x00ff); aChar = theChars.charAt(2*index + 1); outputByte[2] = (byte)((aChar & 0xff00)>>8); outputByte[3] = (byte)(aChar & 0x00ff); for (i = 0; i < outputByte.length; i++) { if (outputByte[i] != 0x00) { allZeroes = false; break; } } if (allZeroes && inputChar != '\u0000') { return CoderResult.unmappableForLength(1); } int oindex = 0; for (spaceNeeded = outputByte.length; spaceNeeded > 1; spaceNeeded--){ if (outputByte[oindex++] != 0x00 ) break; } if (dst.remaining() < spaceNeeded) return CoderResult.OVERFLOW; for (i = outputByte.length - spaceNeeded; i < outputByte.length; i++) { dst.put(outputByte[i]); } mark++; } return CoderResult.UNDERFLOW; } finally { src.position(mark); } } protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { if (true && src.hasArray() && dst.hasArray()) return encodeArrayLoop(src, dst); else return encodeBufferLoop(src, dst); } public byte encode(char inputChar) { return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] + (inputChar & mask2)); } }
⏎ sun/nio/cs/ext/SimpleEUCEncoder.java
Â
⇒ JDK 11 jdk.compiler.jmod - Compiler Tool
2020-08-13, 24480👍, 0💬
Popular Posts:
What Is Apache XMLBeans-2.6.0.zip file? Apache XMLBeans-2.6.0.zip file is the distribution package Z...
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...
commons-lang-1.0.1.jar is the JAR file for Apache Commons Lang 1.0.1, which provides a host of helpe...
Apache Ant Source Code Files are inside the Apache Ant source package file like apache-ant-1.10.10-s...
commons-net-1.4.1.jar is the JAR file for Apache Commons Net 1.4.1, which implements the client side...