home *** CD-ROM | disk | FTP | other *** search
- package netscape.netcast;
-
- import java.io.IOException;
- import java.io.RandomAccessFile;
- import marimba.io.RAFOutputStream;
-
- final class FileCacheOutputStream extends RAFOutputStream {
- FileCacheFile file;
-
- FileCacheOutputStream(FileCacheFile file) throws IOException {
- super(new RandomAccessFile(file, "rw"));
- this.file = file;
- }
-
- public void write(int b) throws IOException {
- super.write(b);
- this.file.cache.notifyData(this.file.getChecksum());
- }
-
- public void write(byte[] b) throws IOException {
- this.write(b, 0, b.length);
- }
-
- public void write(byte[] b, int off, int len) throws IOException {
- super.write(b, off, len);
- this.file.cache.notifyData(this.file.getChecksum());
- }
-
- public void close() throws IOException {
- super.close();
- this.file.cache.notifyComplete(this.file.getChecksum());
- }
- }
-