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

hprose.io.ByteBufferOutputStream Maven / Gradle / Ivy

/**********************************************************\
|                                                          |
|                          hprose                          |
|                                                          |
| Official WebSite: http://www.hprose.com/                 |
|                   http://www.hprose.org/                 |
|                                                          |
\**********************************************************/
/**********************************************************\
 *                                                        *
 * ByteBufferOutputStream.java                            *
 *                                                        *
 * ByteBuffer OutputStream for Java.                      *
 *                                                        *
 * LastModified: Apr 21, 2015                             *
 * Author: Ma Bingyao                   *
 *                                                        *
\**********************************************************/

package hprose.io;

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

public final class ByteBufferOutputStream extends OutputStream {
    public final ByteBufferStream stream;
    ByteBufferOutputStream(ByteBufferStream stream) {
        this.stream = stream;
    }

    @Override
    public final void write(int b) throws IOException {
        stream.write(b);
    }

    @Override
    public final void write(byte b[]) throws IOException {
        stream.write(b);
    }

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

    @Override
    public final void close() throws IOException {
        stream.close();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy