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

com.azure.storage.blob.implementation.util.ByteBufferBackedOutputStreamUtil Maven / Gradle / Ivy

There is a newer version: 12.29.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.storage.blob.implementation.util;

import java.io.OutputStream;
import java.nio.ByteBuffer;

/**
 * This class provides methods for seekable byte channel tests.
 */
public class ByteBufferBackedOutputStreamUtil extends OutputStream {
    private final ByteBuffer dst;

    /**
     * Creates a new ByteBufferBackedOutputStreamUtil.
     *
     * @param dst The destination byte buffer.
     */
    public ByteBufferBackedOutputStreamUtil(ByteBuffer dst) {
        this.dst = dst;
    }

    @Override
    public void write(int b) {
        dst.put((byte) b);
    }

    @Override
    public void write(byte[] b) {
        dst.put(b);
    }

    @Override
    public void write(byte[] b, int off, int len) {
        dst.put(b, off, len);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy