net.sf.juoserver.protocol
Class Huffman

java.lang.Object
  extended by net.sf.juoserver.protocol.Huffman
All Implemented Interfaces:
Encoder, MessageCompressor

public class Huffman
extends Object
implements Encoder, MessageCompressor

Encoder which compresses bytes using the Huffman algorithm.

See Also:
Wikipedia

Constructor Summary
Huffman()
           
 
Method Summary
 Encoder createMessageCompressor()
           
 byte[] encode(byte[] source)
          Encodes a byte array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Huffman

public Huffman()
Method Detail

encode

public byte[] encode(byte[] source)
Description copied from interface: Encoder
Encodes a byte array

Specified by:
encode in interface Encoder
Parameters:
source - byte array to be encoded
Returns:
the encoded packet

createMessageCompressor

public Encoder createMessageCompressor()
Specified by:
createMessageCompressor in interface MessageCompressor


Copyright © 2010-2012. All Rights Reserved.