org.apache.log4j.lf5.util
Class StreamUtils

java.lang.Object
  extended byorg.apache.log4j.lf5.util.StreamUtils

public abstract class StreamUtils
extends Object

Provides utility methods for input and output streams.


Field Summary
static int DEFAULT_BUFFER_SIZE
          Default value is 2048.
 
Constructor Summary
StreamUtils()
           
 
Method Summary
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 copy(InputStream input, OutputStream output, int bufferSize)
          Copies information from the input stream to the output stream using the specified buffer size
static void copyThenClose(InputStream input, OutputStream output)
          Copies information between specified streams and then closes both of the streams.
static byte[] getBytes(InputStream input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
Default value is 2048.

See Also:
Constant Field Values
Constructor Detail

StreamUtils

public StreamUtils()
Method Detail

copy

public static void copy(InputStream input,
                        OutputStream output)
                 throws IOException
Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.

Throws:
IOException

copy

public static void copy(InputStream input,
                        OutputStream output,
                        int bufferSize)
                 throws IOException
Copies information from the input stream to the output stream using the specified buffer size

Throws:
IOException

copyThenClose

public static void copyThenClose(InputStream input,
                                 OutputStream output)
                          throws IOException
Copies information between specified streams and then closes both of the streams.

Throws:
IOException

getBytes

public static byte[] getBytes(InputStream input)
                       throws IOException
Throws:
IOException



Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.