Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.storemate.shared.util;


Simple WithBytesCallback implementation to use when when you need contents to be converted to a UTF-8 String.
 
 public class WithBytesAsUTF8String implements WithBytesCallback<String>
 {
   public final static WithBytesAsUTF8String instance = new WithBytesAsUTF8String();
   @Override
   public String withBytes(byte[] bufferint offsetint length
   {
       if (length <= 0) {
           return "";
       }
       return UTF8Encoder.decodeFromUTF8(bufferoffsetlength);
   }
New to GrepCode? Check out our FAQ X