public abstract class

StreamUtils

extends Object
java.lang.Object
   ↳ org.apache.log4j.lf5.util.StreamUtils

Class Overview

Provides utility methods for input and output streams.

Summary

Constants
int DEFAULT_BUFFER_SIZE Default value is 2048.
Public Constructors
StreamUtils()
Public Methods
static void copy(InputStream input, OutputStream output, int bufferSize)
Copies information from the input stream to the output stream using the specified buffer size
static void copy(InputStream input, OutputStream output)
Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.
static void copyThenClose(InputStream input, OutputStream output)
Copies information between specified streams and then closes both of the streams.
static byte[] getBytes(InputStream input)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int DEFAULT_BUFFER_SIZE

Default value is 2048.

Constant Value: 2048 (0x00000800)

Public Constructors

public StreamUtils ()

Public Methods

public static void copy (InputStream input, OutputStream output, int bufferSize)

Copies information from the input stream to the output stream using the specified buffer size

Throws
IOException

public static void copy (InputStream input, OutputStream output)

Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.

Throws
IOException

public static void copyThenClose (InputStream input, OutputStream output)

Copies information between specified streams and then closes both of the streams.

Throws
IOException

public static byte[] getBytes (InputStream input)

Returns
  • a byte[] containing the information contained in the specified InputStream.
Throws
IOException