phelps.io

Class InputStreams

public class InputStreams extends Object

Utility methods for java.io.InputStreams.

Version: $Revision: 1.2 $ $Date: 2003/08/17 14:00:05 $

Field Summary
static InputStreamDEVNULL
Method Summary
static byte[]toByteArray(InputStream in, int estlength)
Reads the rest of in and returns contents.
static InputStreamuncompress(InputStream is, String fileOrType)
Wraps is with another stream that uncompresses it.

Field Detail

DEVNULL

public static final InputStream DEVNULL

Method Detail

toByteArray

public static byte[] toByteArray(InputStream in, int estlength)
Reads the rest of in and returns contents. Closes in.

uncompress

public static InputStream uncompress(InputStream is, String fileOrType)
Wraps is with another stream that uncompresses it.

Parameters: file filename with compression suffix, or compression type (LZW, gzip, deflate, bzip2).