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:
JRE 8 rt.jar - com.* 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 com.* package in JRE 1.8.0_191 rt.jar. Java source codes are also provided.
✍: FYIcenter
⏎ com/sun/imageio/plugins/jpeg/JPEGBuffer.java
/* * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.imageio.plugins.jpeg; import javax.imageio.stream.ImageInputStream; import javax.imageio.IIOException; import java.io.IOException; /** * A class wrapping a buffer and its state. For efficiency, * the members are made visible to other classes in this package. */ class JPEGBuffer { private boolean debug = false; /** * The size of the buffer. This is large enough to hold all * known marker segments (other than thumbnails and icc profiles) */ final int BUFFER_SIZE = 4096; /** * The actual buffer. */ byte [] buf; /** * The number of bytes available for reading from the buffer. * Anytime data is read from the buffer, this should be updated. */ int bufAvail; /** * A pointer to the next available byte in the buffer. This is * used to read data from the buffer and must be updated to * move through the buffer. */ int bufPtr; /** * The ImageInputStream buffered. */ ImageInputStream iis; JPEGBuffer (ImageInputStream iis) { buf = new byte[BUFFER_SIZE]; bufAvail = 0; bufPtr = 0; this.iis = iis; } /** * Ensures that there are at least <code>count</code> bytes available * in the buffer, loading more data and moving any remaining * bytes to the front. A count of 0 means to just fill the buffer. * If the count is larger than the buffer size, just fills the buffer. * If the end of the stream is encountered before a non-0 count can * be satisfied, an <code>IIOException</code> is thrown with the * message "Image Format Error". */ void loadBuf(int count) throws IOException { if (debug) { System.out.print("loadbuf called with "); System.out.print("count " + count + ", "); System.out.println("bufAvail " + bufAvail + ", "); } if (count != 0) { if (bufAvail >= count) { // have enough return; } } else { if (bufAvail == BUFFER_SIZE) { // already full return; } } // First copy any remaining bytes down to the beginning if ((bufAvail > 0) && (bufAvail < BUFFER_SIZE)) { System.arraycopy(buf, bufPtr, buf, 0, bufAvail); } // Now fill the rest of the buffer int ret = iis.read(buf, bufAvail, buf.length - bufAvail); if (debug) { System.out.println("iis.read returned " + ret); } if (ret != -1) { bufAvail += ret; } bufPtr = 0; int minimum = Math.min(BUFFER_SIZE, count); if (bufAvail < minimum) { throw new IIOException ("Image Format Error"); } } /** * Fills the data array from the stream, starting with * the buffer and then reading directly from the stream * if necessary. The buffer is left in an appropriate * state. If the end of the stream is encountered, an * <code>IIOException</code> is thrown with the * message "Image Format Error". */ void readData(byte [] data) throws IOException { int count = data.length; // First see what's left in the buffer. if (bufAvail >= count) { // It's enough System.arraycopy(buf, bufPtr, data, 0, count); bufAvail -= count; bufPtr += count; return; } int offset = 0; if (bufAvail > 0) { // Some there, but not enough System.arraycopy(buf, bufPtr, data, 0, bufAvail); offset = bufAvail; count -= bufAvail; bufAvail = 0; bufPtr = 0; } // Now read the rest directly from the stream if (iis.read(data, offset, count) != count) { throw new IIOException ("Image format Error"); } } /** * Skips <code>count</code> bytes, leaving the buffer * in an appropriate state. If the end of the stream is * encountered, an <code>IIOException</code> is thrown with the * message "Image Format Error". */ void skipData(int count) throws IOException { // First see what's left in the buffer. if (bufAvail >= count) { // It's enough bufAvail -= count; bufPtr += count; return; } if (bufAvail > 0) { // Some there, but not enough count -= bufAvail; bufAvail = 0; bufPtr = 0; } // Now read the rest directly from the stream if (iis.skipBytes(count) != count) { throw new IIOException ("Image format Error"); } } /** * Push back the remaining contents of the buffer by * repositioning the input stream. */ void pushBack() throws IOException { iis.seek(iis.getStreamPosition()-bufAvail); bufAvail = 0; bufPtr = 0; } /** * Return the stream position corresponding to the next * available byte in the buffer. */ long getStreamPosition() throws IOException { return (iis.getStreamPosition()-bufAvail); } /** * Scan the buffer until the next 0xff byte, reloading * the buffer as necessary. The buffer position is left * pointing to the first non-0xff byte after a run of * 0xff bytes. If the end of the stream is encountered, * an EOI marker is inserted into the buffer and <code>true</code> * is returned. Otherwise returns <code>false</code>. */ boolean scanForFF(JPEGImageReader reader) throws IOException { boolean retval = false; boolean foundFF = false; while (foundFF == false) { while (bufAvail > 0) { if ((buf[bufPtr++] & 0xff) == 0xff) { bufAvail--; foundFF = true; break; // out of inner while } bufAvail--; } // Reload the buffer and keep going loadBuf(0); // Skip any remaining pad bytes if (foundFF == true) { while ((bufAvail > 0) && (buf[bufPtr] & 0xff) == 0xff) { bufPtr++; // Only if it still is 0xff bufAvail--; } } if (bufAvail == 0) { // Premature EOF // send out a warning, but treat it as EOI //reader.warningOccurred(JPEGImageReader.WARNING_NO_EOI); retval = true; buf[0] = (byte)JPEG.EOI; bufAvail = 1; bufPtr = 0; foundFF = true; } } return retval; } /** * Prints the contents of the buffer, in hex. * @param count the number of bytes to print, * starting at the current available byte. */ void print(int count) { System.out.print("buffer has "); System.out.print(bufAvail); System.out.println(" bytes available"); if (bufAvail < count) { count = bufAvail; } for (int ptr = bufPtr; count > 0; count--) { int val = (int)buf[ptr++] & 0xff; System.out.print(" " + Integer.toHexString(val)); } System.out.println(); } }
⏎ com/sun/imageio/plugins/jpeg/JPEGBuffer.java
Or download all of them as a single archive file:
File name: jre-rt-com-1.8.0_191-src.zip File size: 8099783 bytes Release date: 2018-10-28 Download
⇒ Backup JDK 8 Installation Directory
2023-02-07, 254075👍, 3💬
Popular Posts:
MXP1 is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but c...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module. JDK 17 Desktop module compiled ...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.0.2? The if y...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...