org.apache.commons.io.input

Class ClosedInputStream


public class ClosedInputStream
extends InputStream

Closed input stream. This stream returns -1 to all attempts to read something from the stream.

Typically uses of this class include testing for corner cases in methods that accept input streams and acting as a sentinel value instead of a null input stream.

Version:
$Id: ClosedInputStream.java 601751 2007-12-06 14:55:45Z niallp $
Since:
Commons IO 1.4

Field Summary

static ClosedInputStream
CLOSED_INPUT_STREAM
A singleton.

Method Summary

int
read()
Returns -1 to indicate that the stream is closed.

Field Details

CLOSED_INPUT_STREAM

public static final ClosedInputStream CLOSED_INPUT_STREAM
A singleton.

Method Details

read

public int read()
Returns -1 to indicate that the stream is closed.
Returns:
always -1

Copyright (c) 2002-2009 Apache Software Foundation