Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
Collections:
Other Resources:
JDK 17 java.base.jmod - Base Module
JDK 17 java.base.jmod is the JMOD file for JDK 17 Base module.
JDK 17 Base module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.base.jmod.
JDK 17 Base module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Base module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ java/nio/StringCharBuffer.java
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.nio;
import java.util.Objects;
// ## If the sequence is a string, use reflection to share its array
class StringCharBuffer // package-private
extends CharBuffer
{
CharSequence str;
StringCharBuffer(CharSequence s, int start, int end) { // package-private
super(-1, start, end, s.length(), null);
int n = s.length();
Objects.checkFromToIndex(start, end, n);
str = s;
this.isReadOnly = true;
}
public CharBuffer slice() {
int pos = this.position();
int lim = this.limit();
int rem = (pos <= lim ? lim - pos : 0);
return new StringCharBuffer(str,
-1,
0,
rem,
rem,
offset + pos);
}
@Override
public CharBuffer slice(int index, int length) {
Objects.checkFromIndexSize(index, length, limit());
return new StringCharBuffer(str,
-1,
0,
length,
length,
offset + index);
}
private StringCharBuffer(CharSequence s,
int mark,
int pos,
int limit,
int cap,
int offset) {
super(mark, pos, limit, cap, null, offset, null);
str = s;
this.isReadOnly = true;
}
public CharBuffer duplicate() {
return new StringCharBuffer(str, markValue(),
position(), limit(), capacity(), offset);
}
public CharBuffer asReadOnlyBuffer() {
return duplicate();
}
public final char get() {
return str.charAt(nextGetIndex() + offset);
}
public final char get(int index) {
return str.charAt(checkIndex(index) + offset);
}
char getUnchecked(int index) {
return str.charAt(index + offset);
}
// ## Override bulk get methods for better performance
public final CharBuffer put(char c) {
throw new ReadOnlyBufferException();
}
public final CharBuffer put(int index, char c) {
throw new ReadOnlyBufferException();
}
public final CharBuffer compact() {
throw new ReadOnlyBufferException();
}
public final boolean isReadOnly() {
return true;
}
final String toString(int start, int end) {
return str.subSequence(start + offset, end + offset).toString();
}
public final CharBuffer subSequence(int start, int end) {
try {
int pos = position();
return new StringCharBuffer(str,
-1,
pos + checkIndex(start, pos),
pos + checkIndex(end, pos),
capacity(),
offset);
} catch (IllegalArgumentException x) {
throw new IndexOutOfBoundsException();
}
}
public boolean isDirect() {
return false;
}
public ByteOrder order() {
return ByteOrder.nativeOrder();
}
ByteOrder charRegionOrder() {
return null;
}
boolean isAddressable() {
return false;
}
public boolean equals(Object ob) {
if (this == ob)
return true;
if (!(ob instanceof CharBuffer that))
return false;
int thisPos = this.position();
int thisRem = this.limit() - thisPos;
int thatPos = that.position();
int thatRem = that.limit() - thatPos;
if (thisRem < 0 || thisRem != thatRem)
return false;
return BufferMismatch.mismatch(this, thisPos,
that, thatPos,
thisRem) < 0;
}
public int compareTo(CharBuffer that) {
int thisPos = this.position();
int thisRem = this.limit() - thisPos;
int thatPos = that.position();
int thatRem = that.limit() - thatPos;
int length = Math.min(thisRem, thatRem);
if (length < 0)
return -1;
int i = BufferMismatch.mismatch(this, thisPos,
that, thatPos,
length);
if (i >= 0) {
return Character.compare(this.get(thisPos + i), that.get(thatPos + i));
}
return thisRem - thatRem;
}
}
⏎ java/nio/StringCharBuffer.java
Or download all of them as a single archive file:
File name: java.base-17.0.5-src.zip File size: 8883851 bytes Release date: 2022-09-13 Download
2023-09-26, ≈924🔥, 1💬
Popular Posts:
Java Servlet API 3.0.1 Source Code Files are important if you want to compile them with different JD...
commons-net-1.4.1.jar is the JAR file for Apache Commons Net 1.4.1, which implements the client side...
JDK 11 jdk.crypto.mscapi.jmod is the JMOD file for JDK 11 Crypto MSCAPI module. JDK 11 Crypto MSCAPI...
Apache BCEL Source Code Files are inside the Apache BCEL source package file like bcel-6.5.0-src.zip...
JDK 17 jdk.internal.opt.jmod is the JMOD file for JDK 17 Internal Opt module. JDK 17 Internal Opt mo...