Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getStringFromFile(InputStream fromFile) throws IOException {
- // Use FileInputStream to read the file
- FileInputStream datFile = (FileInputStream)fromFile;
- byte[] b = new byte[datFile.available()];
- datFile.read(b);
- // get the content of file
- String datFileContent = new String(b);
- datFile.close();
- return datFileContent;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement