-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
c0fa81a
commit b72d12e
Showing
10 changed files
with
36 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ build | |
.vscode | ||
*/logs | ||
*.gz | ||
|
||
*.log |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright $YEAR [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -17,10 +17,10 @@ | |
package io.optimism; | ||
|
||
/** | ||
* batcher main method. | ||
* Batcher main method. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public class HildrBatcher { | ||
public static void main(String[] args) { | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -20,10 +20,10 @@ | |
import java.io.Flushable; | ||
|
||
/** | ||
* tx data bytes compressor interface. | ||
* Tx data bytes compressor interface. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public interface Compressor extends Closeable, Readable, Flushable { | ||
|
||
|
@@ -33,25 +33,26 @@ public interface Compressor extends Closeable, Readable, Flushable { | |
*/ | ||
int write(byte[] p); | ||
|
||
// read compressed data; should only be called after Close. | ||
/** | ||
* read compressed data; should only be called after Close. | ||
* | ||
* @param p read buffer bytes to this byte array | ||
*/ | ||
int read(byte[] p); | ||
|
||
// reset all written data. | ||
/** reset all written data. */ | ||
void reset(); | ||
|
||
// returns an estimate of the current length of the compressed data; calling Flush will | ||
// increase the accuracy at the expense of a poorer compression ratio. | ||
/** | ||
* returns an estimate of the current length of the compressed data; calling Flush will. increase | ||
* the accuracy at the expense of a poorer compression ratio. | ||
*/ | ||
int length(); | ||
|
||
// returns CompressorFullException if the compressor is known to be full. Note that | ||
// calls to Write will fail if an error is returned from this method, but calls to Write | ||
// can still return CompressorFullErr even if this does not. | ||
/** | ||
* returns CompressorFullException if the compressor is known to be full. Note that calls to Write | ||
* will fail if an error is returned from this method, but calls to Write can still return | ||
* CompressorFullErr even if this does not. | ||
*/ | ||
void fullErr(); | ||
|
||
//// Closer Close function should be called before reading any data. | ||
// io.Closer | ||
//// Flush flushes any uncompressed data to the compression buffer. This will result in a | ||
//// non-optimal compression ratio. | ||
// Flush() error | ||
|
||
} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -20,6 +20,6 @@ | |
* Compressor Factory. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public class CompressorFactory {} |
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -20,7 +20,7 @@ | |
* Compressor create tool. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public interface Compressors { | ||
|
||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -20,7 +20,7 @@ | |
* Compressor Config. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
* @param targetFrameSize to target when creating channel frames. Note that if the realized | ||
* compression ratio is worse than the approximate, more frames may actually be created. This | ||
* also depends on how close the target is to the max frame size. | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -24,12 +24,12 @@ | |
* RatioCompressor class. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public class RatioCompressor implements Compressor { | ||
|
||
RatioCompressor() { | ||
// todo 看看有没有更高性能的工具,如果没有就使用java.util.zip.Deflater | ||
// todo plan to use java.util.zip.Deflater | ||
} | ||
|
||
@Override | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -24,7 +24,7 @@ | |
* ShadowCompressor class. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public class ShadowCompressor implements Compressor { | ||
|
||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright 2023 [email protected] | ||
* Copyright [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | ||
|
@@ -21,7 +21,7 @@ | |
* full. | ||
* | ||
* @author thinkAfCod | ||
* @since 2023.07 | ||
* @since 0.1.1 | ||
*/ | ||
public class CompressorFullException extends RuntimeException { | ||
|
||
|