|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.tranche.streams.WrappedOutputStream
public class WrappedOutputStream
A wrapper class that lets the AddFielTool upload data on-the-fly without requiring temporary files when downloading. This greatly speeds up uploads and significantly reduces disk access times.
| Constructor Summary | |
|---|---|
WrappedOutputStream(java.io.OutputStream out,
BigHashMaker bhm)
Creates a wrapped output stream that will automatically create an appropriate BigHash from the bytes streamed through it. |
|
WrappedOutputStream(java.io.OutputStream out,
BigHashMaker bhm,
java.lang.String algorithm,
java.security.PrivateKey key)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the wrapped OutputStream. |
void |
flush()
Flushes any bytes being buffered. |
byte[] |
getSignatureBytes()
Returns the appropriate bytes to represent a signature for this file. |
void |
write(byte[] b)
Writes a complete buffer of bytes. |
void |
write(byte[] buf,
int off,
int len)
Writes using a buffer and respecting offset and length. |
void |
write(int b)
Writes a single byte out a time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WrappedOutputStream(java.io.OutputStream out,
BigHashMaker bhm)
Creates a wrapped output stream that will automatically create an appropriate BigHash from the bytes streamed through it.
out - The OutputStream to write bytes to. This wrapper will pass all bytes.bhm - The BigHashMaker that will be updated as bytes are written to this class.
public WrappedOutputStream(java.io.OutputStream out,
BigHashMaker bhm,
java.lang.String algorithm,
java.security.PrivateKey key)
out - bhm - algorithm - key - | Method Detail |
|---|
public void write(byte[] buf,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreambuf - off - len -
java.io.IOException
public void write(byte[] b)
throws java.io.IOException
Writes a complete buffer of bytes.
write in class java.io.OutputStreamb -
java.io.IOException
public void write(int b)
throws java.io.IOException
Writes a single byte out a time. Not recommended for speed.
write in class java.io.OutputStreamb -
java.io.IOException
public void flush()
throws java.io.IOException
Flushes any bytes being buffered. This class doesn't not buffer bytes from the wrapped OutputStream.
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException
public void close()
throws java.io.IOException
Closes the wrapped OutputStream.
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOExceptionpublic byte[] getSignatureBytes()
Returns the appropriate bytes to represent a signature for this file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||