/** * Copy an InputStream into an array of bytes and return * an InputStream against those bytes. The input stream * is copied until EOF is returned. This is useful to provide * streams to applications in order to isolate them from * Derby's internals. * * @param in InputStream to be copied * @param bufferSize Initial size of the byte array * * @return InputStream against the raw data. * * @throws IOException Error reading the stream */ public static InputStream copyStream(InputStream in, int bufferSize) throws IOException { AccessibleByteArrayOutputStream raw = new AccessibleByteArrayOutputStream(bufferSize); raw.readFrom(in); return raw.getInputStream(); } }
/** Get a reference to the data array the class data is being built in. No copy is made. */ public byte[] getData() { return ((AccessibleByteArrayOutputStream) out).getInternalByteArray(); }
public void write(byte[] b, int off, int len) throws IOException { out.write(b,off,len); tee.write(b,off,len); }
void checkObject(Formatable f) { new ByteArrayInputStream(tee.getInternalByteArray(), 0, tee.size());
public ClassFormatOutput(int size) { this(new AccessibleByteArrayOutputStream(size)); } public ClassFormatOutput(java.io.OutputStream stream) {
public void writeTo(OutputStream outTo) throws IOException { ((AccessibleByteArrayOutputStream) out).writeTo(outTo); }
return AccessibleByteArrayOutputStream.copyStream(jarIn, size);
void checkObject(Formatable f) { new ByteArrayInputStream(tee.getInternalByteArray(), 0, tee.size());
public ClassFormatOutput(int size) { this(new AccessibleByteArrayOutputStream(size)); } public ClassFormatOutput(java.io.OutputStream stream) {
public void writeTo(OutputStream outTo) throws IOException { ((AccessibleByteArrayOutputStream) out).writeTo(outTo); }
return AccessibleByteArrayOutputStream.copyStream(jarIn, size);
/** * Copy an InputStream into an array of bytes and return * an InputStream against those bytes. The input stream * is copied until EOF is returned. This is useful to provide * streams to applications in order to isolate them from * Derby's internals. * * @param in InputStream to be copied * @param bufferSize Initial size of the byte array * * @return InputStream against the raw data. * * @throws IOException Error reading the stream */ public static InputStream copyStream(InputStream in, int bufferSize) throws IOException { AccessibleByteArrayOutputStream raw = new AccessibleByteArrayOutputStream(bufferSize); raw.readFrom(in); return raw.getInputStream(); } }
void checkObject(Formatable f) { new ByteArrayInputStream(tee.getInternalByteArray(), 0, tee.size());
public void write(int b) throws IOException { out.write(b); tee.write(b); }
/** Get a reference to the data array the class data is being built in. No copy is made. */ public byte[] getData() { return ((AccessibleByteArrayOutputStream) out).getInternalByteArray(); }
public ClassFormatOutput(int size) { this(new AccessibleByteArrayOutputStream(size)); } public ClassFormatOutput(java.io.OutputStream stream) {
public void writeTo(OutputStream outTo) throws IOException { ((AccessibleByteArrayOutputStream) out).writeTo(outTo); }
return AccessibleByteArrayOutputStream.copyStream(jarIn, size);
/** * Copy an InputStream into an array of bytes and return * an InputStream against those bytes. The input stream * is copied until EOF is returned. This is useful to provide * streams to applications in order to isolate them from * Derby's internals. * * @param in InputStream to be copied * @param bufferSize Initial size of the byte array * * @return InputStream against the raw data. * * @throws IOException Error reading the stream */ public static InputStream copyStream(InputStream in, int bufferSize) throws IOException { AccessibleByteArrayOutputStream raw = new AccessibleByteArrayOutputStream(bufferSize); raw.readFrom(in); return raw.getInputStream(); } }
public void write(int b) throws IOException { out.write(b); tee.write(b); }