--- old/src/java.desktop/share/classes/javax/imageio/stream/MemoryCache.java Mon Aug 25 12:52:03 2014
+++ new/src/java.desktop/share/classes/javax/imageio/stream/MemoryCache.java Mon Aug 25 12:52:02 2014
@@ -82,6 +82,8 @@
* or the end of the source is reached. The return value
* is equal to the smaller of pos
and the
* length of the source.
+ *
+ * @throws IOException if there is no more memory for cache
*/
public long loadFromStream(InputStream stream, long pos)
throws IOException {
@@ -143,6 +145,8 @@
* the requested data is not in the cache (including if pos
* is in a block already disposed), or if either pos
or
* len
is < 0.
+ * @throws IOException if there is an I/O exception while writing to the
+ * stream
*/
public void writeToStream(OutputStream stream, long pos, long len)
throws IOException {
@@ -177,6 +181,8 @@
/**
* Ensure that there is space to write a byte at the given position.
+ *
+ * throws IOException if there is no more memory left for cache
*/
private void pad(long pos) throws IOException {
long currIndex = cacheStart + cache.size() - 1;
@@ -197,7 +203,7 @@
* the incoming data.
*
* @param b an array of bytes containing data to be written.
- * @param off the starting offset withing the data array.
+ * @param off the starting offset within the data array.
* @param len the number of bytes to be written.
* @param pos the cache position at which to begin writing.
*
@@ -205,6 +211,7 @@
* @exception IndexOutOfBoundsException if off
,
* len
, or pos
are negative,
* or if off+len > b.length
.
+ * @throws IOException if there is an I/O error while writing to the cache
*/
public void write(byte[] b, int off, int len, long pos)
throws IOException {
@@ -248,6 +255,7 @@
* @param pos the cache position at which to begin writing.
*
* @exception IndexOutOfBoundsException if pos
is negative.
+ * @throws IOException if there is an I/O error while writing to the cache
*/
public void write(int b, long pos) throws IOException {
if (pos < 0) {
@@ -279,6 +287,9 @@
* Returns the single byte at the given position, as an
* int
. Returns -1 if this position has
* not been cached or has been disposed.
+ *
+ * @throws IOException if an I/O error occurs while reading from the byte
+ * array
*/
public int read(long pos) throws IOException {
if (pos >= length) {
@@ -304,6 +315,8 @@
* off + len > b.length
or if any portion of the
* requested data is not in the cache (including if
* pos
is in a block that has already been disposed).
+ * @throws IOException if an I/O exception occurs while reading from the
+ * byte array
*/
public void read(byte[] b, int off, int len, long pos)
throws IOException {