Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String content = "";
- try {
- InputStream in = this.getClass().getResourceAsStream("asdf.txt");
- byte[] buffer = new byte[5000];
- while (in.read(buffer) != -1) {
- content += new String(buffer);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- String content = "";
- Reader in = new InputStreamReader(this.getClass().getResourceAsStream("asdf.txt"), THE_ENCODING);
- StringBuffer temp = new StringBuffer(1024);
- char[] buffer = new char[1024];
- int read;
- while ((read=in.read(buffer, 0, buffer.len)) != -1) {
- temp.append(buffer, 0, read);
- }
- content = temp.toString().
Add Comment
Please, Sign In to add comment