Browse Source

Cleaned up file a bit and made it package access.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270315 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
1ef7d3b0cb
2 changed files with 20 additions and 16 deletions
  1. +10
    -8
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/StreamPumper.java
  2. +10
    -8
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/StreamPumper.java

+ 10
- 8
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/StreamPumper.java View File

@@ -16,7 +16,8 @@ import java.io.OutputStream;
*
* @author thomas.haas@softwired-inc.com
*/
public class StreamPumper implements Runnable
class StreamPumper
implements Runnable
{

// TODO: make SIZE and SLEEP instance variables.
@@ -24,8 +25,8 @@ public class StreamPumper implements Runnable

private final static int SLEEP = 5;
private final static int SIZE = 128;
private InputStream is;
private OutputStream os;
private InputStream m_input;
private OutputStream m_output;

/**
* Create a new stream pumper.
@@ -33,10 +34,11 @@ public class StreamPumper implements Runnable
* @param is input stream to read data from
* @param os output stream to write data to.
*/
public StreamPumper( InputStream is, OutputStream os )
public StreamPumper( final InputStream input,
final OutputStream output )
{
this.is = is;
this.os = os;
m_input = input;
m_output = output;
}

/**
@@ -50,9 +52,9 @@ public class StreamPumper implements Runnable
int length;
try
{
while( ( length = is.read( buf ) ) > 0 )
while( ( length = m_input.read( buf ) ) > 0 )
{
os.write( buf, 0, length );
m_output.write( buf, 0, length );
try
{
Thread.sleep( SLEEP );


+ 10
- 8
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/exec/StreamPumper.java View File

@@ -16,7 +16,8 @@ import java.io.OutputStream;
*
* @author thomas.haas@softwired-inc.com
*/
public class StreamPumper implements Runnable
class StreamPumper
implements Runnable
{

// TODO: make SIZE and SLEEP instance variables.
@@ -24,8 +25,8 @@ public class StreamPumper implements Runnable

private final static int SLEEP = 5;
private final static int SIZE = 128;
private InputStream is;
private OutputStream os;
private InputStream m_input;
private OutputStream m_output;

/**
* Create a new stream pumper.
@@ -33,10 +34,11 @@ public class StreamPumper implements Runnable
* @param is input stream to read data from
* @param os output stream to write data to.
*/
public StreamPumper( InputStream is, OutputStream os )
public StreamPumper( final InputStream input,
final OutputStream output )
{
this.is = is;
this.os = os;
m_input = input;
m_output = output;
}

/**
@@ -50,9 +52,9 @@ public class StreamPumper implements Runnable
int length;
try
{
while( ( length = is.read( buf ) ) > 0 )
while( ( length = m_input.read( buf ) ) > 0 )
{
os.write( buf, 0, length );
m_output.write( buf, 0, length );
try
{
Thread.sleep( SLEEP );


Loading…
Cancel
Save