Java Utililty Methods InputStream Close

List of utility methods to do InputStream Close

Description

The list of methods to do InputStream Close are organized into topic(s).

Method

voidclose(InputStream closeable)
close
try {
    if (closeable != null) {
        closeable.close();
} catch (IOException e) {
voidclose(InputStream in)
Safe close of an InputStream (no exceptions, even if reference is null).
try {
    in.close();
} catch (Exception ignore) {
voidclose(InputStream in)
close
try {
    in.close();
} catch (IOException e) {
voidclose(InputStream in)
close
try {
    in.close();
} catch (Exception x) {
voidclose(InputStream in)
Closes the inputstream created from Util.fileOrStdin unless it is System.in.
if (!System.in.equals(in)) {
    try {
        in.close();
    } catch (IOException e) {
        System.err.println("could not close InputStream " + in.toString());
voidclose(InputStream in)
close
if (in != null) {
    try {
        in.close();
    } catch (IOException ignore) {
voidclose(InputStream in)
Attempts to close the stream, suppressing all exceptions.
try {
    in.close();
} catch (Exception e) {
voidclose(InputStream in)
close
if (in != null) {
    try {
        in.close();
    } catch (IOException e) {
        closingFailed(e);
voidclose(InputStream in)
close
try {
    if (in != null) {
        in.close();
} catch (IOException e) {
    e.printStackTrace();
} finally {
    in = null;
...
voidclose(InputStream in)
Closes the given InputStream.
try {
    if (in != null) {
        in.close();
        in = null;
} catch (final IOException e) {
    throw e;
} finally {
...