io.virtdata.libbasics.shared.conversions.from_bytebuffer.ToHexString Maven / Gradle / Ivy
package io.virtdata.libbasics.shared.conversions.from_bytebuffer;
import io.virtdata.annotations.Categories;
import io.virtdata.annotations.Category;
import io.virtdata.annotations.ThreadSafeMapper;
import org.apache.commons.codec.binary.Hex;
import java.nio.ByteBuffer;
import java.util.function.Function;
@Categories(Category.conversion)
@ThreadSafeMapper
public class ToHexString implements Function {
private final boolean useUpperCase;
public ToHexString() {
this(true);
}
public ToHexString(boolean useUpperCase) {
this.useUpperCase = useUpperCase;
}
@Override
public String apply(ByteBuffer byteBuffer) {
return Hex.encodeHexString(byteBuffer,useUpperCase);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy