All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.io.stream.ClosedInputStream Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.io.stream;

import java.io.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 {@code null} input stream. */ public class ClosedInputStream extends InputStream { /** * A singleton. */ public static final ClosedInputStream INSTANCE = new ClosedInputStream(); /** * Returns -1 to indicate that the stream is closed. * * @return always -1 */ @Override public int read() { return -1; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy