import java.io.*; // Verweis auf Package public class Buffer { private byte[] buffer=null; private FileInputStream src=null; private FileOutputStream dest=null; public Buffer(int size) { buffer = new byte[size]; } public void openFile4Reading(String source) { try { src = new FileInputStream(source); } catch (FileNotFoundException ex) { } } public void openFile4Writing(String destination) { try { dest = new FileOutputStream(destination); } catch (FileNotFoundException ex) { } } public void close() { try { if (src!=null) src.close(); if (dest!=null) dest.close(); src=null; dest=null; } catch (IOException e2) { } } public int readBytes() { int n=-1; try { n = src.read(buffer); // lesen eines Blockes } catch (IOException e) { System.out.println("IOException"); } finally { return n; } } // readBytes public void writeBytes(int n) { try { if (n>0) dest.write(buffer, 0, n); // lesen eines Blockes } catch (IOException e) { System.out.println("IOException"); } } // readBytes } // Buffer