com.buck.common.codec
Class CodecDecoder

java.lang.Object
  extended by com.buck.common.codec.CodecDecoder

public abstract class CodecDecoder
extends Object

An engine that can transform a sequence of bytes in a specific encoding into a sequence of bytes.

Author:
Robert J. Buck

Constructor Summary
protected CodecDecoder(Codec codec)
          Initializes a new decoder.
 
Method Summary
 Codec codec()
          Returns the codec that created this decoder.
abstract  byte[] decode(byte[] encoded)
          Decodes encoded data using the codec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodecDecoder

protected CodecDecoder(Codec codec)
Initializes a new decoder.

Parameters:
codec - The codec for this decoder.
Method Detail

codec

public final Codec codec()
Returns the codec that created this decoder.

Returns:
This decoder's codec

decode

public abstract byte[] decode(byte[] encoded)
Decodes encoded data using the codec.

Parameters:
encoded - the encoded data
Returns:
the decoded byte array


Copyright © 2013. All Rights Reserved.