org.torweg.pulse.vfs
Class VFOutputStream
java.lang.Object
java.io.OutputStream
org.torweg.pulse.vfs.VFOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public final class VFOutputStream
- extends java.io.OutputStream
an OutputStream to write to VirtualFiles.
- Version:
- $Revision: 1769 $
- Author:
- Thomas Weber
|
Constructor Summary |
protected |
VFOutputStream(java.io.OutputStream out, VirtualFile f, User u)
creates a new VFOutputStream from the given OutputStream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VFOutputStream
protected VFOutputStream(java.io.OutputStream out, VirtualFile f, User u)
- creates a new
VFOutputStream from the given OutputStream.
- Parameters:
out - the underlying OutputStreamf - the VirtualFile associated with the OutputStreamu - the user who uses the stream
close
public void close()
throws java.io.IOException
- closes the
VFOutputStream, initialises the distribution of the
underlying VirtualFile (see
VirtualFileSystem.distribute(VirtualFile, User)) and finally
indexes the content of the VirtualFile (see
VirtualFileSystem.index(VirtualFile)) for full text searching.
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.OutputStream
- Throws:
java.io.IOException - on errors closing the stream or distributing the file- See Also:
OutputStream.close()
flush
public void flush()
throws java.io.IOException
- Specified by:
flush in interface java.io.Flushable- Overrides:
flush in class java.io.OutputStream
- Throws:
java.io.IOException - on I/O errors- See Also:
OutputStream.flush()
write
public void write(int b)
throws java.io.IOException
- Specified by:
write in class java.io.OutputStream
- Parameters:
b - the next byte to write
- Throws:
java.io.IOException - on I/O errors- See Also:
OutputStream.write(int)
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write in class java.io.OutputStream
- Parameters:
b - the data
- Throws:
java.io.IOException - on I/O errors- See Also:
OutputStream.write(byte[])
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write in class java.io.OutputStream
- Parameters:
b - the dataoff - the start offset in the datalen - the number of bytes to write
- Throws:
java.io.IOException - on I/O errors- See Also:
OutputStream.write(byte[])