Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.storemate.shared.util;
 
Simple WithBytesCallback implementation to use when all you really want is a byte array copy.
 
 public class WithBytesAsArray implements WithBytesCallback<byte[]>
    public final static WithBytesAsArray instance = new WithBytesAsArray();
    @Override
    public byte[] withBytes(byte[] bufferint offsetint length) {
        if (offset == 0) {
            return Arrays.copyOf(bufferlength);
        }
        return Arrays.copyOfRange(bufferoffsetoffset+length);
    }
New to GrepCode? Check out our FAQ X