org.mentalog.encoder.NullEncoder 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;
public class NullEncoder implements Encoder {
public static byte[] NULL = "null".getBytes();
@Override
public boolean encode(Object obj, ByteBuffer bb, int varargsPos, int varargsLen) {
if (obj == null) {
bb.put(NULL);
return true;
}
return false;
}
}