Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.bounceme.dur.client;
- import java.io.BufferedInputStream;
- import java.io.IOException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- public class Template {
- private static final Logger log = Logger.getLogger(Template.class.getName());
- StringBuffer buffer = new StringBuffer();
- public Template() {
- }
- public String getTemplate() {
- return buffer.toString();
- }
- public void load() {
- try (BufferedInputStream input = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream("template.txt"))) {
- int data = input.read();
- while (data != -1) {
- buffer.append((char) data);
- data = input.read();
- }
- } catch (IOException ex) {
- Logger.getLogger(Template.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment