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

io.quarkus.vertx.core.runtime.BufferOutputStream Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.vertx.core.runtime;

import java.io.IOException;
import java.io.OutputStream;

import io.vertx.core.buffer.Buffer;

/**
 * Simple {@link OutputStream} implementation that appends content
 * written in given {@link Buffer} instance.
 */
public class BufferOutputStream extends OutputStream {

    private final Buffer buffer;

    public BufferOutputStream(Buffer buffer) {
        this.buffer = buffer;
    }

    @Override
    public void write(byte[] b, int off, int len) throws IOException {
        buffer.appendBytes(b, off, len);
    }

    @Override
    public void write(int b) throws IOException {
        buffer.appendInt(b);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy