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

src.samples.java.ex.UTWR_Sample Maven / Gradle / Ivy

Go to download

An auxiliary findbugs.sourceforge.net plugin for java bug detectors that fall outside the narrow scope of detectors to be packaged with the product itself.

There is a newer version: 7.6.8
Show newest version
package ex;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class UTWR_Sample {
    public void utwrStream(File f) throws IOException {
        InputStream is = new FileInputStream(f);
        try {
            is.read();
        } finally {
            if (is != null) {
                is.close();
            }
        }
    }

    public void fpUTWRStream(File f) throws IOException {
        try (InputStream is = new FileInputStream(f)) {
            is.read();
        }
    }

    public void fpInitializeProperties(InputStream is, Properties props) {
        try (InputStream r = new BufferedInputStream(is)) {
            props.load(r);
        } catch (IOException e) {
            System.out.println("Failed to load properties: " + e);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy