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 1.1 Source Code Directory
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes:
"C:\fyicenter\jdk-1.1.8\src".
Here is the list of Java classes of the JDK 1.1 source code:
✍: FYIcenter
⏎ java/io/PipedReader.java
/*
* @(#)PipedReader.java 1.7 01/12/10
*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.io;
/**
* Piped character-input streams.
*
* @version 1.7, 01/12/10
* @author Mark Reinhold
* @since JDK1.1
*/
public class PipedReader extends Reader {
PipedInputStream byteSink;
private byte buf[]; /* Conversion buffer */
private int leftOver = 0;
/**
* Create a reader that is not yet connected to a piped writer.
*/
public PipedReader() {
byteSink = new PipedInputStream();
lock = byteSink;
}
/**
* Create a reader for the specified piped character-output stream.
*/
public PipedReader(PipedWriter src) throws IOException {
this();
connect(src);
}
/** Check to make sure that the stream has not been closed */
private void ensureOpen() throws IOException {
if (byteSink == null)
throw new IOException("Stream closed");
}
/**
* Connect the specified piped writer to this reader.
*
* @exception IOException If this reader is already connected
*/
public void connect(PipedWriter src) throws IOException {
synchronized (lock) {
ensureOpen();
src.connect(this);
}
}
/**
* Read characters into a portion of an array.
*
* @param cbuf Destination buffer
* @param off Offset at which to start storing characters
* @param len Maximum number of characters to read
*
* @return The number of characters read, or -1 if the end of the
* stream has been reached
*
* @exception IOException If an I/O error occurs
*/
public int read(char cbuf[], int off, int len) throws IOException {
synchronized (lock) {
ensureOpen();
int blen = leftOver + len * 2;
if ((buf == null) || (buf.length < blen))
buf = new byte[blen];
int nb = byteSink.read(buf, leftOver, blen);
if (nb < 0)
return -1;
nb += leftOver;
for (int i = 0; i < nb; i += 2)
cbuf[i >> 1] = (char) (((buf[i] & 0xff) << 8)
| (buf[i + 1] & 0xff));
if (nb % 2 != 0) {
buf[0] = buf[nb - 1];
leftOver = 1;
}
else
leftOver = 0;
return nb / 2;
}
}
/**
* Close the stream.
*
* @exception IOException If an I/O error occurs
*/
public void close() throws IOException {
synchronized (lock) {
if (byteSink == null)
return;
byteSink.close();
byteSink = null;
}
}
}
⏎ java/io/PipedReader.java
Or download all of them as a single archive file:
File name: jdk-1.1.8-src.zip File size: 1574187 bytes Release date: 2018-11-16 Download
⇒ Backup JDK 1.1 Installation Directory
2018-11-17, ≈407🔥, 0💬
Popular Posts:
JDK 11 jdk.internal.JVM Stat.jmod is the JMOD file for JDK 11 Internal Jvmstat module. JDK 11 Intern...
JDK 17 jdk.incubator.foreign.jm odis the JMOD file for JDK 17 HTTP Server module. JDK 17 Incubator F...
maven-model-builder-3.5. 4.jaris the JAR file for Apache Maven 3.5.4 Model Builder module. Apache Ma...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...
HttpComponents Core Source Code Files are provided in the source package file, httpcomponents-core-5...