All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.storemate.shared.util.WithBytesAsContainer Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package com.fasterxml.storemate.shared.util;

import com.fasterxml.storemate.shared.ByteContainer;

/**
 * Simple {@link WithBytesCallback} implementation to use when you
 * just want a {@link ByteContainer} as a result.
 */
public class WithBytesAsContainer implements WithBytesCallback
{
    public final static WithBytesAsContainer instance = new WithBytesAsContainer();

    @Override
    public ByteContainer withBytes(byte[] buffer, int offset, int length) {
        if (offset == 0) {
            return ByteContainer.emptyContainer();
        }
        return ByteContainer.simple(buffer, offset, length);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy