Class FSPOutputStream
-
- All Implemented Interfaces:
-
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class FSPOutputStream extends OutputStream
Stream for writing file to FSP server. You can not have more than one file opened for write per FSPsession.
- Since:
1.0rc7
Radim Kolar
-
-
Constructor Summary
Constructors Constructor Description FSPOutputStream(FSPsession session, String filename)Creates stream for writing file to FSP server.
-
Method Summary
Modifier and Type Method Description voidflush()Flushes internal buffer to FSP server. voidwrite(int b)Writes single byte to FSP server voidwrite(Array<byte> b, int off, int len)Writes byte array to FSP server voidclose()Flushes buffer and installs file. voidfinalize()cancels pending upload and unlocks writer object. -
-
Constructor Detail
-
FSPOutputStream
FSPOutputStream(FSPsession session, String filename)
Creates stream for writing file to FSP server. Because FSP protocol always uploads to temporary file no checking if client can really create/overwrite desired file is performed until end of upload. Custom timestamp on uploaded file is not supported by this class. This constructor will block if there is already another active writing stream assigned to FSPsession.
- Parameters:
session- FSPsession to target serverfilename- filename
-
-
Method Detail
-
flush
void flush()
Flushes internal buffer to FSP server. File on FSP server is not created until stream is closed. This function always sent packet to server even if internal buffer is currently empty.
- Since:
1.0rc7
-
write
void write(int b)
Writes single byte to FSP server
- Parameters:
b- byte to write- Since:
1.0rc7
-
write
void write(Array<byte> b, int off, int len)
Writes byte array to FSP server
- Parameters:
b- array containing data to writeoff- data to write offsetlen- lenght of data to write- Since:
1.0rc7
-
close
void close()
Flushes buffer and installs file. Setting filestamp on target file is not supported by this function.
- Since:
1.0rc7
-
finalize
void finalize()
cancels pending upload and unlocks writer object. This function will fail if FSPsession was finalized sooner
- Since:
1.0rc8
-
-
-
-