pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.vfs
Class VFOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by 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.
 
Method Summary
 void close()
          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.
 void flush()
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFOutputStream

protected VFOutputStream(java.io.OutputStream out, VirtualFile f, User u)
creates a new VFOutputStream from the given OutputStream.

Parameters:
out - the underlying OutputStream
f - the VirtualFile associated with the OutputStream
u - the user who uses the stream
Method Detail

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 data
off - the start offset in the data
len - the number of bytes to write
Throws:
java.io.IOException - on I/O errors
See Also:
OutputStream.write(byte[])