*/
public void encode( ByteBuffer byteBuffer, DhcpMessage message )
{
byteBuffer.put( message.getOp() );
HardwareAddress hardwareAddress = message.getHardwareAddress();
byteBuffer.put( ( byte ) ( null != hardwareAddress ? hardwareAddress.getType() : 0 ) );
byteBuffer.put( ( byte ) ( null != hardwareAddress ? hardwareAddress.getLength() : 0 ) );
byteBuffer.put( ( byte ) message.getHopCount() );
byteBuffer.putInt( message.getTransactionId() );
byteBuffer.putShort( ( short ) message.getSeconds() );
byteBuffer.putShort( message.getFlags() );
writeAddress( byteBuffer, message.getCurrentClientAddress() );
writeAddress( byteBuffer, message.getAssignedClientAddress() );
writeAddress( byteBuffer, message.getNextServerAddress() );
writeAddress( byteBuffer, message.getRelayAgentAddress() );
writeBytes( byteBuffer, ( null != hardwareAddress ? hardwareAddress.getAddress() : new byte[]
{} ), 16 );
writeString( byteBuffer, message.getServerHostname(), 64 );
writeString( byteBuffer, message.getBootFileName(), 128 );