Dieses Beispiel teilt den spezifischen Code von Java Close Streaming Connection IO -Tool für Ihre Referenz. Der spezifische Inhalt ist wie folgt
package com.demo.utils;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.Reader;import java.io.Writer;/** * Close the stream connection IO tool class* @author dongyangyang * @Date 2016/12/28 23:12 * @Version 1.0 * */public class Ioutils {public static void close (InputStream in) {if (in! = Null) {try {in.close (); } catch (ioException e) {}}} public static void close (outputStream) {if (out! = null) {try {out.close (); } catch (ioException e) {}}} public static void close (reader r) {if (r! = null) {try {r.close (); } catch (ioException e) {}}} public static void close (writer w) {if (w! = null) {try {w.close (); } catch (ioException e) {}}}}Das obige ist der gesamte Inhalt dieses Artikels. Ich hoffe, es wird für das Lernen aller hilfreich sein und ich hoffe, jeder wird Wulin.com mehr unterstützen.