|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.io.Mixer
Class for mixing streams with garbage bytes. Mixing consists of
then unmixing consists ofMixer mixer = ...; OutputStream mixedOutput = mixer.new OutputStream(nativeOutput); ... // Use 'mixedOutput' here mixedOutput.close(); byte[] trace = mixer.getTrace();
byte[] trace = ... Mixer mixer = ... mixer.setTrace(trace); InputStream unmixedInput = mixer.new InputStream(mixedInput); ... // Use 'unmixedInput' here
Nested Class Summary | |
class |
Mixer.InputStream
Inner-class for transparently unmixing an mixed stream |
class |
Mixer.OutputStream
Inner-class for transparently mixing a stream The trace is stored back in the outer Mixer instance
once the close() method is called |
Field Summary | |
static sam.io.Mixer |
DUMMY
Dummy mixer implementation. |
Constructor Summary | |
Mixer()
|
Method Summary | |
protected long |
blockSize()
Gets the block size of this mixer. |
protected abstract long |
getDataChunkLength(long blockSize)
Sets the next data chunk length, in bytes. |
byte[] |
getTrace()
Gets the current mixing trace since creation of the stream |
long |
nextDataChunkLength(long blockSize)
Sets the next data chunk length, in bytes. |
abstract void |
readGarbageChunk(java.io.InputStream stream,
long length)
Reads garbage data from the stream. |
void |
setBlockSize(long blockSize)
Sets the block size. |
void |
setTrace(byte[] trace)
Sets the current mixing trace |
void |
setTracker(sam.io.Tracker tracker)
Sets the tracker. |
abstract void |
writeGarbageChunk(java.io.OutputStream stream)
Writes garbage data to the stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final sam.io.Mixer DUMMY
Constructor Detail |
public Mixer()
Method Detail |
protected abstract long getDataChunkLength(long blockSize)
blockSize
- the block size of the data stream,
which might be zero to specify infinite block size
A lazy implementation might just return blockSize
public long nextDataChunkLength(long blockSize)
blockSize
- the block size of the data stream,
which might be zero to specify infinite block size
A lazy implementation might just return blockSize
long
to specify unlimited data chunkpublic abstract void writeGarbageChunk(java.io.OutputStream stream) throws java.io.IOException
stream
- the output to write onto
Note that the number of bytes written will be kept back automatically
java.io.IOException
public abstract void readGarbageChunk(java.io.InputStream stream, long length) throws java.io.IOException
stream
- the input to write ontolength
- the number of garbage bytes to read
java.io.IOException
protected long blockSize()
public void setBlockSize(long blockSize)
public void setTracker(sam.io.Tracker tracker)
public byte[] getTrace()
public void setTrace(byte[] trace)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |