FileDocCategorySizeDatePackage
DemuxInputStream.javaAPI DocApache Ant 1.702176Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant

DemuxInputStream

public class DemuxInputStream extends InputStream
Passes input requests to the project object for demuxing into individual tasks and threads.
since
Ant 1.6

Fields Summary
private Project
project
The project to from which to get input.
Constructors Summary
public DemuxInputStream(Project project)
Create a DemuxInputStream for the given project

param
project the project instance

        this.project = project;
    
Methods Summary
public intread()
Read a byte from the project's demuxed input.

return
the next byte
throws
IOException on error

        byte[] buffer = new byte[1];
        if (project.demuxInput(buffer, 0, 1) == -1) {
            return -1;
        }
        return buffer[0];
    
public intread(byte[] buffer, int offset, int length)
Read bytes from the project's demuxed input.

param
buffer an array of bytes to read into
param
offset the offset in the array of bytes
param
length the number of bytes in the array
return
the number of bytes read
throws
IOException on error

        return project.demuxInput(buffer, offset, length);