Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
闫逍旭
committed
Mar 8, 2016
1 parent
39742bc
commit 2458ea7
Showing
9 changed files
with
106 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
mpush-tools/src/test/java/com/shinemo/mpush/tools/IOUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,61 @@ | |||
package com.shinemo.mpush.tools; | |||
|
|||
import org.junit.Test; | |||
|
|||
import static org.junit.Assert.*; | |||
|
|||
/** | |||
* Created by ohun on 2016/3/8. | |||
*/ | |||
public class IOUtilsTest { | |||
|
|||
@Test | |||
public void testCompress() throws Exception { | |||
byte[] s = ("士大夫士大大啊实打实大苏打撒" + | |||
"阿斯顿撒大苏打实打实的苏打似的啊实" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"打实大苏打实打实大苏打水水" + | |||
"水水水水夫").getBytes(); | |||
long t1 = System.currentTimeMillis(); | |||
for (int i = 0; i < 100; i++) { | |||
IOUtils.compress(s); | |||
} | |||
System.out.println((System.currentTimeMillis()-t1)); | |||
System.out.println("src:" + s.length); | |||
byte[] out = IOUtils.compress(s); | |||
System.out.println("compress:" + out.length); | |||
byte[] ss = IOUtils.uncompress(out); | |||
System.out.println("uncompress:" + ss.length); | |||
} | |||
|
|||
@Test | |||
public void testUncompress() throws Exception { | |||
|
|||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters