Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 jdk.charsets.jmod - Charsets Module
JDK 17 jdk.charsets.jmod is the JMOD file for JDK 17 Charsets module.
JDK 17 Charsets module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.charsets.jmod.
JDK 17 Charsets module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Charsets module source code files are stored in \fyicenter\jdk-17.0.5\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, 2021, 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(); byte[] da = dst.array(); int dp = dst.arrayOffset() + dst.position(); int dl = dst.arrayOffset() + dst.limit(); 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
Or download all of them as a single archive file:
File name: jdk.charsets-17.0.5-src.zip File size: 2039497 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.compiler.jmod - Compiler Tool
2023-10-15, 10062👍, 0💬
Popular Posts:
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
Apache Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use Log4j 2 instead. Bytec...
What Is javamail1_1_3.zip? javamail1_1_3.zip is the binary package of JavaMail API 1.1.3 in ZIP form...
commons-io-1.4.jar is the JAR file for Commons IO 1.4, which is a library of utilities to assist wit...
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...