/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Resource Interchange File Format (RIFF) stream decoder.
*
* @author Karl Helgason
*/
private long avail;
if (stream instanceof RIFFReader)
else
root = this;
// Check for RIFF null paddings,
int b;
while (true) {
b = read();
if (b == -1) {
// because it is expected to
// always contain a string value
avail = 0;
return;
}
if (b != 0)
break;
}
byte[] fourcc = new byte[4];
fourcc[0] = (byte) b;
ckSize = readUnsignedInt();
byte[] format = new byte[4];
}
}
return root.filepointer;
}
if (lastiterator != null)
return avail != 0;
}
if (lastiterator != null)
if (avail == 0)
return null;
lastiterator = new RIFFReader(this);
return lastiterator;
}
return fourcc;
}
return riff_type;
}
public long getSize() {
return ckSize;
}
if (avail == 0)
return -1;
if (b == -1)
return -1;
avail--;
filepointer++;
return b;
}
if (avail == 0)
return -1;
if (rlen != -1)
filepointer += rlen;
avail = 0;
return rlen;
} else {
if (ret == -1)
return -1;
filepointer += ret;
return ret;
}
}
}
if (len < 0)
throw new IndexOutOfBoundsException();
while (len > 0) {
if (s < 0)
throw new EOFException();
if (s == 0)
off += s;
len -= s;
}
}
if (n < 0)
return 0;
long skipped = 0;
while (skipped != n) {
if (s < 0)
break;
if (s == 0)
skipped += s;
}
return skipped;
}
if (avail == 0)
return -1;
if (n > avail) {
if (len != -1)
filepointer += len;
avail = 0;
return len;
} else {
if (ret == -1)
return -1;
filepointer += ret;
return ret;
}
}
public int available() {
return (int)avail;
}
if (avail != 0) {
}
}
// Read ASCII chars from stream
if (buff[i] == 0) {
}
}
}
// Read 8 bit signed integer from stream
if (ch < 0)
throw new EOFException();
return (byte) ch;
}
// Read 16 bit signed integer from stream
if (ch1 < 0)
throw new EOFException();
if (ch2 < 0)
throw new EOFException();
}
// Read 32 bit signed integer from stream
if (ch1 < 0)
throw new EOFException();
if (ch2 < 0)
throw new EOFException();
if (ch3 < 0)
throw new EOFException();
if (ch4 < 0)
throw new EOFException();
}
// Read 64 bit signed integer from stream
if (ch1 < 0)
throw new EOFException();
if (ch2 < 0)
throw new EOFException();
if (ch3 < 0)
throw new EOFException();
if (ch4 < 0)
throw new EOFException();
if (ch5 < 0)
throw new EOFException();
if (ch6 < 0)
throw new EOFException();
if (ch7 < 0)
throw new EOFException();
if (ch8 < 0)
throw new EOFException();
}
// Read 8 bit unsigned integer from stream
if (ch < 0)
throw new EOFException();
return ch;
}
// Read 16 bit unsigned integer from stream
if (ch1 < 0)
throw new EOFException();
if (ch2 < 0)
throw new EOFException();
}
// Read 32 bit unsigned integer from stream
if (ch1 < 0)
throw new EOFException();
if (ch2 < 0)
throw new EOFException();
if (ch3 < 0)
throw new EOFException();
if (ch4 < 0)
throw new EOFException();
}
finish();
if (this == root)
}
}