public class StreamWorker extends Object
Utility class to provide common operations upon streams that are used for communication between client and server.
Copyright 2010 (C) by Martin Ganserer
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
| Constructor and Description |
|---|
StreamWorker()
Default constructor
|
StreamWorker(int bufferSize)
Constructor to define size of internal buffer
|
| Modifier and Type | Method and Description |
|---|---|
Object |
readObjectFromStream(InputStream in,
boolean decrypt)
Read serialized object from input stream
|
void |
writeObjectToStream(Serializable object,
OutputStream out,
boolean encrypt)
Write object to stream
|
void |
writeToOutput(InputStream in,
OutputStream out,
boolean encryptOutput,
boolean decryptInput)
Write data from input stream to output stream
|
public static final int DEFAULT_BUFFER_SIZE
public StreamWorker()
public StreamWorker(int bufferSize)
bufferSize - public void writeToOutput(InputStream in, OutputStream out, boolean encryptOutput, boolean decryptInput) throws Exception
in - out - encryptOutput - decryptInput - Exceptionpublic Object readObjectFromStream(InputStream in, boolean decrypt) throws Exception
in - decrypt - Exceptionpublic void writeObjectToStream(Serializable object, OutputStream out, boolean encrypt) throws Exception
object - out - encrypt - ExceptionCopyright © 2016. All rights reserved.