public final class OutputStreamBuilder extends OutputStream
Modifier and Type | Method and Description |
---|---|
Object |
build()
Builds the result of using this builder as either a
CachedOutputStream
if stream caching is enabled, otherwise byte[]. |
void |
close() |
void |
flush() |
static OutputStreamBuilder |
withExchange(org.apache.camel.Exchange exchange)
Creates a new OutputStreamBuilder with the current exchange
Use the
build() when writing to the stream is finished, and you need the result of this operation. |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static OutputStreamBuilder withExchange(org.apache.camel.Exchange exchange)
build()
when writing to the stream is finished, and you need the result of this operation.exchange
- the current Exchangepublic void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public Object build() throws IOException
CachedOutputStream
if stream caching is enabled, otherwise byte[].IOException
Apache Camel