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

org.sapia.ubik.util.ByteVectorOutputStream Maven / Gradle / Ivy

The newest version!
package org.sapia.ubik.util;

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

/**
 * This class implements an OutputStream over a ByteVector. The 
 * underlying vector can be reused by calling its clear() method 
 * (which will bring the vector back to its post-creation state).
 * 

* WARNING: THIS CLASS IS NOT THREAD-SAFE. * * @author Yanick Duchesne * *

*
Copyright:
Copyright © 2002-2005 Sapia Open Source Software. All Rights Reserved.
*
License:
Read the license.txt file of the jar or visit the * license page at the Sapia OSS web site
*
*/ public class ByteVectorOutputStream extends OutputStream { private ByteVector _bytes; public ByteVectorOutputStream(ByteVector bytes){ _bytes = bytes; } /** * @return the underlying ByteVector to which this instance writes. */ public ByteVector getByteVector(){ return _bytes; } /** * @see java.io.OutputStream#close() */ public void close() throws IOException { } /** * @see java.io.OutputStream#flush() */ public void flush() throws IOException { } /** * @see java.io.OutputStream#write(byte[], int, int) */ public void write(byte[] b, int off, int len) throws IOException { _bytes.write(b, off, len); } /** * @see java.io.OutputStream#write(byte[]) */ public void write(byte[] b) throws IOException { _bytes.write(b); } /** * @see java.io.OutputStream#write(int) */ public void write(int b) throws IOException { _bytes.write(b); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy