1 18 19 package org.apache.tools.ant; 20 21 import java.io.IOException ; 22 import java.io.InputStream ; 23 24 31 public class DemuxInputStream extends InputStream { 32 33 36 private Project project; 37 38 43 public DemuxInputStream(Project project) { 44 this.project = project; 45 } 46 47 52 public int read() throws IOException { 53 byte[] buffer = new byte[1]; 54 if (project.demuxInput(buffer, 0, 1) == -1) { 55 return -1; 56 } 57 return buffer[0]; 58 } 59 60 61 69 public int read(byte[] buffer, int offset, int length) throws IOException { 70 return project.demuxInput(buffer, offset, length); 71 } 72 73 } 74 | Popular Tags |