Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start of a command-line filter program

  • Loading branch information...
commit bfea68ba7f061c2cbcfded2c8e9c3a3f91436b91 1 parent 65b06e3
@league authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 net/contrapunctus/lzma/Command.java
View
25 net/contrapunctus/lzma/Command.java
@@ -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));
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.