Initial commit from SVN.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.de22.javabytecode.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import com.common.io.*;
|
||||
|
||||
/**
|
||||
* Copyright Wynne Crisman 1999,2006<p>
|
||||
*/
|
||||
public class ByteCodeOutputStream extends StandardOutputStream {
|
||||
/**
|
||||
* ByteCodeOutputStream constructor.
|
||||
* The size of the initial buffer in bytes.
|
||||
*/
|
||||
public ByteCodeOutputStream(int bufferSize) {
|
||||
super(new BufferedOutputStream(new ByteArrayOutputStream(bufferSize, false)));
|
||||
}//ByteCodeOutputStream()//
|
||||
/**
|
||||
* ByteCodeOutputStream constructor.
|
||||
* @param outputStream The buffered output stream to wrapper.
|
||||
*/
|
||||
protected ByteCodeOutputStream(BufferedOutputStream outputStream) {
|
||||
super(outputStream);
|
||||
}//ByteCodeOutputStream()//
|
||||
/**
|
||||
* @see BufferedOutputStream.getByteIndex()
|
||||
*/
|
||||
public int getByteIndex() {
|
||||
return ((BufferedOutputStream) getOutputStream()).getByteIndex();
|
||||
}//getByteIndex()//
|
||||
/**
|
||||
* @see BufferedOutputStream.getInsertOutputStream(int)
|
||||
*/
|
||||
public ByteCodeOutputStream getInsertOutputStream(int reservedByteCount) throws IOException {
|
||||
return new ByteCodeOutputStream(((BufferedOutputStream) getOutputStream()).getInsertOutputStream(reservedByteCount));
|
||||
}//getInsertOutputStream()//
|
||||
/**
|
||||
* @see BufferedOutputStream.getInsertOutputStream(int, int)
|
||||
*/
|
||||
public ByteCodeOutputStream getInsertOutputStream(int bufferSize, int incrementSize) throws IOException {
|
||||
return new ByteCodeOutputStream(((BufferedOutputStream) getOutputStream()).getInsertOutputStream(bufferSize, incrementSize));
|
||||
}//getInsertOutputStream()//
|
||||
/**
|
||||
* @see BufferedOutputStream.getOutputStreamLocation()
|
||||
*/
|
||||
public IOutputStreamLocation getOutputStreamLocation() throws IOException {
|
||||
return ((BufferedOutputStream) getOutputStream()).getOutputStreamLocation();
|
||||
}//getOutputStreamLocation()//
|
||||
/**
|
||||
* @see ByteArrayOutputStream.toByteArray()
|
||||
*/
|
||||
public byte[] toByteArray() throws IOException {
|
||||
return ((BufferedOutputStream) getOutputStream()).toByteArray();
|
||||
}//toByteArray()//
|
||||
}//ByteCodeOutputStream//
|
||||
Reference in New Issue
Block a user