de.huxhorn.lilith.sender
Class ZeroDelimitedWriteByteStrategy

java.lang.Object
  extended by de.huxhorn.lilith.sender.ZeroDelimitedWriteByteStrategy
All Implemented Interfaces:
WriteByteStrategy

public class ZeroDelimitedWriteByteStrategy
extends java.lang.Object
implements WriteByteStrategy


Constructor Summary
ZeroDelimitedWriteByteStrategy()
           
 
Method Summary
 void writeBytes(java.io.DataOutputStream dataOutputStream, byte[] bytes)
          Writes the byte array if it contains any data, followed by a zero-byte.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZeroDelimitedWriteByteStrategy

public ZeroDelimitedWriteByteStrategy()
Method Detail

writeBytes

public void writeBytes(java.io.DataOutputStream dataOutputStream,
                       byte[] bytes)
                throws java.io.IOException
Writes the byte array if it contains any data, followed by a zero-byte.

Specified by:
writeBytes in interface WriteByteStrategy
Parameters:
dataOutputStream - the stream the bytes will be written to.
bytes - the bytes that are written
Throws:
java.io.IOException - if an exception is thrown while writing the bytes.