Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.FileReader;
- public static void copyCharacters() throws IOException {
- FileReader inputStream = null;
- FileWriter outputStream = null;
- try {
- inputStream = new FileReader("Motown.txt");
- outputStream = new FileWriter("Motown_output.txt");
- int c;
- while ((c = inputStream.read()) != -1) {
- outputStream.write(c);
- }
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
- if (outputStream != null) {
- outputStream.close();
- }
- }
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- try {
- copyCharacters();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment