Java Utililty Methods InputStreamReader Read

List of utility methods to do InputStreamReader Read

Description

The list of methods to do InputStreamReader Read are organized into topic(s).

Method

StringreadFile(String name)
read File
InputStream is = null;
BufferedReader reader = null;
StringBuilder fileContents = new StringBuilder();
try {
    is = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
    reader = new BufferedReader(new InputStreamReader(is));
    while (true) {
        String line = reader.readLine();
...
StringreadFile(String nomeFile)
read File
InputStream is;
InputStreamReader isr = null;
StringBuilder sb = new StringBuilder();
char[] buf = new char[1024];
int len;
try {
    is = new FileInputStream(nomeFile);
    isr = new InputStreamReader(is);
...
StringreadFile(String p_filename)
Read the content of a TEXT file
int len = (int) (new File(p_filename)).length();
StringBuffer buf = new StringBuffer(len);
BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(p_filename)));
try {
    do {
        String data = r.readLine();
        if (data == null) {
            break;
...
StringReadFile(String Path)
Read File
BufferedReader reader = null;
String laststr = "";
try {
    FileInputStream fileInputStream = new FileInputStream(Path);
    InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
    reader = new BufferedReader(inputStreamReader);
    String tempString = null;
    while ((tempString = reader.readLine()) != null) {
...
StringreadFile(String path)
read File
File myFile = new File(path);
FileInputStream fIn;
try {
    if (!myFile.exists()) {
        if (myFile.getParentFile() != null) {
            myFile.getParentFile().mkdirs();
        myFile.createNewFile();
...
StringreadFile(String path)
read File
StringBuilder sb = new StringBuilder();
BufferedReader br = null;
br = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"));
String line;
if ((line = br.readLine()) != null)
    sb.append(line);
while ((line = br.readLine()) != null) {
    sb.append(System.getProperty("line.separator"));
...
StringreadFile(String path)
read File
return readFile(new File(path));
StringreadFile(String path)
Returns the content of the given file.
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
if (is == null) {
    throw new FileNotFoundException("Can't find \"" + path + "\".");
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
try {
    String line;
...
StringreadFile(String Path)
read File
BufferedReader reader = null;
String laststr = "";
try {
    FileInputStream fileInputStream = new FileInputStream(Path);
    InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
    reader = new BufferedReader(inputStreamReader);
    String tempString = null;
    while ((tempString = reader.readLine()) != null) {
...
StringreadFile(String path)
read File
BufferedReader br = new BufferedReader(
        new InputStreamReader(new DataInputStream(new FileInputStream(path))));
String line;
StringBuffer sb = new StringBuffer();
while ((line = br.readLine()) != null) {
    sb.append(line);
return sb.toString();
...