org.mentalog.encoder.AsciiEncoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of menta-log Show documentation
Show all versions of menta-log Show documentation
A log library that embraces the kiss principle.
package org.mentalog.encoder;
import java.nio.ByteBuffer;
import org.mentalog.AsciiEncodable;
public class AsciiEncoder implements Encoder {
@Override
public boolean encode(Object obj, ByteBuffer bb, int varargsPos, int varargsLen) {
if (obj instanceof AsciiEncodable) {
AsciiEncodable asciiEncodable = (AsciiEncodable) obj;
asciiEncodable.toAscii(bb);
return true;
}
return false;
}
}