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:
JRE 8 rt.jar - javax.* Package Source Code
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries.
JRE (Java Runtime) 8 is the runtime environment included in JDK 8.
JRE 8 rt.jar libraries are divided into 6 packages:
com.* - Internal Oracle and Sun Microsystems libraries java.* - Standard Java API libraries. javax.* - Extended Java API libraries. jdk.* - JDK supporting libraries. org.* - Third party libraries. sun.* - Old libraries developed by Sun Microsystems.
JAR File Information:
Directory of C:\fyicenter\jdk-1.8.0_191\jre\lib
63,596,151 rt.jar
Here is the list of Java classes of the javax.* package in JRE 1.8.0_191 rt.jar. Java source codes are also provided.
✍: FYIcenter
⏎ javax/imageio/stream/MemoryCacheImageOutputStream.java
/*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.imageio.stream;
import java.io.IOException;
import java.io.OutputStream;
/**
* An implementation of <code>ImageOutputStream</code> that writes its
* output to a regular <code>OutputStream</code>. A memory buffer is
* used to cache at least the data between the discard position and
* the current write position. The only constructor takes an
* <code>OutputStream</code>, so this class may not be used for
* read/modify/write operations. Reading can occur only on parts of
* the stream that have already been written to the cache and not
* yet flushed.
*
*/
public class MemoryCacheImageOutputStream extends ImageOutputStreamImpl {
private OutputStream stream;
private MemoryCache cache = new MemoryCache();
/**
* Constructs a <code>MemoryCacheImageOutputStream</code> that will write
* to a given <code>OutputStream</code>.
*
* @param stream an <code>OutputStream</code> to write to.
*
* @exception IllegalArgumentException if <code>stream</code> is
* <code>null</code>.
*/
public MemoryCacheImageOutputStream(OutputStream stream) {
if (stream == null) {
throw new IllegalArgumentException("stream == null!");
}
this.stream = stream;
}
public int read() throws IOException {
checkClosed();
bitOffset = 0;
int val = cache.read(streamPos);
if (val != -1) {
++streamPos;
}
return val;
}
public int read(byte[] b, int off, int len) throws IOException {
checkClosed();
if (b == null) {
throw new NullPointerException("b == null!");
}
// Fix 4467608: read([B,I,I) works incorrectly if len<=0
if (off < 0 || len < 0 || off + len > b.length || off + len < 0) {
throw new IndexOutOfBoundsException
("off < 0 || len < 0 || off+len > b.length || off+len < 0!");
}
bitOffset = 0;
if (len == 0) {
return 0;
}
// check if we're already at/past EOF i.e.
// no more bytes left to read from cache
long bytesLeftInCache = cache.getLength() - streamPos;
if (bytesLeftInCache <= 0) {
return -1; // EOF
}
// guaranteed by now that bytesLeftInCache > 0 && len > 0
// and so the rest of the error checking is done by cache.read()
// NOTE that alot of error checking is duplicated
len = (int)Math.min(bytesLeftInCache, (long)len);
cache.read(b, off, len, streamPos);
streamPos += len;
return len;
}
public void write(int b) throws IOException {
flushBits(); // this will call checkClosed() for us
cache.write(b, streamPos);
++streamPos;
}
public void write(byte[] b, int off, int len) throws IOException {
flushBits(); // this will call checkClosed() for us
cache.write(b, off, len, streamPos);
streamPos += len;
}
public long length() {
try {
checkClosed();
return cache.getLength();
} catch (IOException e) {
return -1L;
}
}
/**
* Returns <code>true</code> since this
* <code>ImageOutputStream</code> caches data in order to allow
* seeking backwards.
*
* @return <code>true</code>.
*
* @see #isCachedMemory
* @see #isCachedFile
*/
public boolean isCached() {
return true;
}
/**
* Returns <code>false</code> since this
* <code>ImageOutputStream</code> does not maintain a file cache.
*
* @return <code>false</code>.
*
* @see #isCached
* @see #isCachedMemory
*/
public boolean isCachedFile() {
return false;
}
/**
* Returns <code>true</code> since this
* <code>ImageOutputStream</code> maintains a main memory cache.
*
* @return <code>true</code>.
*
* @see #isCached
* @see #isCachedFile
*/
public boolean isCachedMemory() {
return true;
}
/**
* Closes this <code>MemoryCacheImageOutputStream</code>. All
* pending data is flushed to the output, and the cache
* is released. The destination <code>OutputStream</code>
* is not closed.
*/
public void close() throws IOException {
long length = cache.getLength();
seek(length);
flushBefore(length);
super.close();
cache.reset();
cache = null;
stream = null;
}
public void flushBefore(long pos) throws IOException {
long oFlushedPos = flushedPos;
super.flushBefore(pos); // this will call checkClosed() for us
long flushBytes = flushedPos - oFlushedPos;
cache.writeToStream(stream, oFlushedPos, flushBytes);
cache.disposeBefore(flushedPos);
stream.flush();
}
}
⏎ javax/imageio/stream/MemoryCacheImageOutputStream.java
Or download all of them as a single archive file:
File name: jre-rt-javax-1.8.0_191-src.zip File size: 5381005 bytes Release date: 2018-10-28 Download
⇒ JRE 8 rt.jar - org.* Package Source Code
2024-07-16, ≈469🔥, 7💬
Popular Posts:
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...
JDK 17 jdk.internal.vm.ci.jmod is the JMOD file for JDK 17 Internal VM CI module. JDK 17 Internal VM...
Java Architecture for XML Binding (JAXB) is a Java API that allows Java developers to map Java class...
How to download and install Apache XMLBeans-2.6.0.zip? If you want to try the XMLBeans Java library,...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...