org.mentalog.encoder
Class ByteOrCharArrayEncoder

java.lang.Object
  extended by org.mentalog.encoder.ByteOrCharArrayEncoder
All Implemented Interfaces:
Encoder

public class ByteOrCharArrayEncoder
extends Object
implements Encoder


Field Summary
 
Fields inherited from interface org.mentalog.encoder.Encoder
ASCII, BYTE_OR_CHAR_ARRAY, CHAR_SEQUENCE, NULL, THROWABLE
 
Constructor Summary
ByteOrCharArrayEncoder()
           
 
Method Summary
 boolean encode(Object obj, ByteBuffer bb, int varargsPos, int varargsLen)
          Encode the given object into the provided byte buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteOrCharArrayEncoder

public ByteOrCharArrayEncoder()
Method Detail

encode

public boolean encode(Object obj,
                      ByteBuffer bb,
                      int varargsPos,
                      int varargsLen)
Description copied from interface: Encoder
Encode the given object into the provided byte buffer. Note: You should use instanceof to check and cast the object to a type that this encoder can encode. Each encoder receives all objects passed to the log() method. If a encoder receives an object it does not support, it does nothing and returns false, so the next encoder in the chain will be applied.

Specified by:
encode in interface Encoder
Parameters:
obj - That object to be encoded.
bb - The byte buffer that will receive the encoded object.
Returns:
true if the object was encoded, false otherwise


Copyright © 2013. All Rights Reserved.