Example usage for java.io Reader close

List of usage examples for java.io Reader close

Introduction

In this page you can find the example usage for java.io Reader close.

Prototype

public abstract void close() throws IOException;

Source Link

Document

Closes the stream and releases any system resources associated with it.

Usage

From source file:Main.java

/**
 * Closes a Reader.//from  www.  j a v a2 s  .c  o  m
 *
 * @param reader    Reader to close. If reader is null then method just returns.
 */
public static void safeClose(@Nullable Reader reader) {
    if (reader == null)
        return;

    try {
        reader.close();
    } catch (IOException e) {
        // We made out best effort to release this resource. Nothing more we can do.
    }
}

From source file:Main.java

private static void closeQuietly(Reader reader) {
    if (reader != null) {
        try {//from w ww .  ja v a2s.c  om
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

From source file:Main.java

/**
 * Close the specified reader, ignoring any exceptions.
 *///from   ww  w  .  j  a v  a 2s .  co  m
public static void closeQuietly(Reader reader) {
    try {
        reader.close();
    } catch (final Exception e) {
        // Ignored
    }
}

From source file:Main.java

private static void close(Reader reader) {
    try {//  w  ww .  j  av a  2s .c o  m
        if (reader == null)
            return;
        reader.close();
    } catch (Exception localException) {
    }
}

From source file:Main.java

public static void closeQuietly(Reader reader) {

    if (reader != null) {
        try {//  ww  w. j ava 2 s  .  c  o  m
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            reader = null;
        }
    }
}

From source file:com.pvub.sabre.discovery.SabreRequestHandler.java

protected static void close(Reader br) {
    try {//w  w w  . ja  v  a 2  s  . co m
        if (br != null) {
            br.close();
        }
    } catch (Exception e) {
        // Ignore
        e.printStackTrace();
    }
}

From source file:Main.java

public static void close(Reader reader) {
    if (reader != null) {
        try {//from ww  w.  ja  va  2  s.  c o  m
            reader.close();
        } catch (IOException e) {
            closingFailed(e);
        }
    }
}

From source file:Main.java

public static void close(Reader closeable) {
    if (closeable != null)
        try {//from  ww w .j av a2  s  .co  m
            closeable.close();
        } catch (Exception ignored) {
        }
}

From source file:Main.java

public static final void close(final Reader in) {
    if (in != null) {
        try {//  w w w  .ja va  2  s .c o m
            in.close();
        } catch (IOException e) {
            // silent
        }
    }
}

From source file:Main.java

public final static void closeQuietly(Reader r) {
    try {/*  w  ww  . j  a  va 2 s .  com*/
        if (r != null)
            r.close();
    } catch (Exception e) {
        Log.e("OpenVPN", "closing InputStream", e);
    }
}