Skip to content

Commit

Permalink
start of a command-line filter program
Browse files Browse the repository at this point in the history
  • Loading branch information
league committed Nov 2, 2009
1 parent 65b06e3 commit bfea68b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions net/contrapunctus/lzma/Command.java
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.contrapunctus.lzma;

import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;

public class Command
{
static void copy(InputStream in, OutputStream out) throws IOException
{
final int BUFSIZE = 4096;
byte[] buf = new byte[BUFSIZE];
int n = in.read(buf);
while(n != -1) {
out.write(buf, 0, n);
n = in.read(buf);
}
out.close();
}

public static void main(String[] args) throws IOException
{
copy(System.in, new LzmaOutputStream(System.out));
}
}

0 comments on commit bfea68b

Please sign in to comment.