1 package org.columba.core.io; 17 18 import java.io.IOException ; 19 import java.io.InputStream ; 20 21 28 public class CloneInputStream extends InputStream { 29 private CloneStreamMaster model; 30 31 private int id; 32 33 40 protected CloneInputStream(CloneStreamMaster model, int id) { 41 super(); 42 this.model = model; 43 this.id = id; 44 } 45 46 47 50 @Override 51 public int read() throws IOException { 52 return model.read(id); 53 } 54 55 56 59 @Override 60 public int read(byte[] arg0, int arg1, int arg2) throws IOException { 61 return model.read(id, arg0, arg1, arg2); 62 } 63 64 65 68 @Override 69 public int available() throws IOException { 70 return model.available(); 71 } 72 73 76 @Override 77 public void close() throws IOException { 78 if (model != null) { 79 model.close(id); 80 model = null; 81 } 82 } 83 } 84 | Popular Tags |