Permalink
Browse files

more dead code elimination, to increase coverage

  • Loading branch information...
1 parent 9300876 commit 308e33cfc87fb513a09d71057f7a8bb92a2471e4 @league committed Sep 15, 2009
Showing with 0 additions and 41 deletions.
  1. +0 −5 net/contrapunctus/lzma/EncoderThread.java
  2. +0 −36 net/contrapunctus/lzma/LzmaInputStream.java
@@ -32,11 +32,6 @@
DEBUG = ds != null;
}
- EncoderThread( OutputStream _out )
- {
- this(_out, DEFAULT_DICT_SZ_POW2, null);
- }
-
/**
* @param dictSzPow2 If non-null, equivalent to the N in the -dN arg to LzmaAlone
* @param fastBytes If non-null, equivalent to the N in the -fbN arg to LzmaAlone
@@ -43,40 +43,4 @@ public String toString( )
{
return String.format("lzmaIn@%x", hashCode());
}
-
- public static void main( String[] args ) throws IOException
- {
- // first compress
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- PrintStream ps = new PrintStream( baos );
- ps.print("I will try decoding this text.");
- ps.close();
- byte[] buf = baos.toByteArray();
- ByteArrayInputStream bis = new ByteArrayInputStream( buf );
- baos = new ByteArrayOutputStream();
- Encoder enc = new Encoder();
- enc.SetEndMarkerMode(true);
- enc.WriteCoderProperties( baos );
- enc.Code( bis, baos, -1, -1, null );
- buf = baos.toByteArray();
-
- // then decompress traditionally
- bis = new ByteArrayInputStream( buf );
- Decoder dec = new Decoder();
- byte[] props = new byte[5];
- bis.read( props, 0, 5 );
- dec.SetDecoderProperties( props );
- dec.Code( bis, System.out, -1 );
- System.out.println();
-
- // and using stream
- bis = new ByteArrayInputStream( buf );
- LzmaInputStream is = new LzmaInputStream( bis );
- //for( int k = is.read(); k != -1; k = is.read() )
- // {
- // System.out.printf("%02x %c%n", k, (char)k);
- // }
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- System.out.println(br.readLine());
- }
}

0 comments on commit 308e33c

Please sign in to comment.