Top Description Constructors Methods
org.xnio.streams

public final Class Streams

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, .UnsupportedEncodingException, java.nio.charset.Charset, .UnsupportedCharsetException, org.xnio.IoUtils

Stream utility class.
Author
David M. Lloyd

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
copyStream(InputStream
the source stream
input
,
OutputStream
the destination stream
output
,
boolean
true if the input and output streams should be closed
close
,
int
the buffer size
bufferSize
)

Copy from one stream to another.

public static void
copyStream(InputStream
the source stream
input
,
OutputStream
the destination stream
output
,
boolean
true if the input and output streams should be closed
close
)

Copy from one stream to another.

public static void
copyStream(InputStream
the source stream
input
,
OutputStream
the destination stream
output
)

Copy from one stream to another.

pack-priv static Charset
getCharset(final String charsetName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Streamsback to summary
private Streams()

Method Detail

copyStreamback to summary
public static void copyStream(InputStream input, OutputStream output, boolean close, int bufferSize) throws IOException

Copy from one stream to another.

Parameters
input:InputStream

the source stream

output:OutputStream

the destination stream

close:boolean

true if the input and output streams should be closed

bufferSize:int

the buffer size

Exceptions
IOException:
if an I/O error occurs
copyStreamback to summary
public static void copyStream(InputStream input, OutputStream output, boolean close) throws IOException

Copy from one stream to another. A default buffer size is assumed.

Parameters
input:InputStream

the source stream

output:OutputStream

the destination stream

close:boolean

true if the input and output streams should be closed

Exceptions
IOException:
if an I/O error occurs
copyStreamback to summary
public static void copyStream(InputStream input, OutputStream output) throws IOException

Copy from one stream to another. A default buffer size is assumed, and both streams are closed on completion.

Parameters
input:InputStream

the source stream

output:OutputStream

the destination stream

Exceptions
IOException:
if an I/O error occurs
getCharsetback to summary
pack-priv static Charset getCharset(final String charsetName) throws UnsupportedEncodingException