net.sf.microlog.core.IOUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microlog-logger-core
Show all versions of microlog-logger-core
Contains the Microlog core classes
The newest version!
package net.sf.microlog.core;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.Connection;
/**
* Some I/O utilities to be used in a Java ME CLDC environment.
*
* @author Johan Karlsson
*
*/
public class IOUtil {
/**
* Close the InputStream
silent.
*
* @param inputStream
* the InputStream
to close.
*/
public static void closeSilent(InputStream inputStream) {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* Close the OutputStream
silent.
*
* @param inputStream
* the OutputStream
to close.
*/
public static void closeSilent(OutputStream outputStream) {
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
* Close the Connection
silent.
*
* @param connection
* the Connection
to close.
*/
public static void closeSilent(Connection connection) {
if (connection != null) {
try {
connection.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}