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

com.lambdaworks.redis.output.ByteArrayOutput Maven / Gradle / Ivy

// Copyright (C) 2012 - Will Glozer.  All rights reserved.

package com.lambdaworks.redis.output;

import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.protocol.CommandOutput;

import java.nio.ByteBuffer;

/**
 * Byte array output.
 *
 * @author Will Glozer
 */
public class ByteArrayOutput extends CommandOutput {
    public ByteArrayOutput(RedisCodec codec) {
        super(codec, null);
    }

    @Override
    public void set(ByteBuffer bytes) {
        if (bytes != null) {
            output = new byte[bytes.remaining()];
            bytes.get(output);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy