From 6687b216d888fd52fc81f5cf4c7aa20ccb4c7099 Mon Sep 17 00:00:00 2001 From: thinkAfCod Date: Mon, 31 Jul 2023 11:41:07 +0800 Subject: [PATCH] fix format --- .gitignore | 2 +- config/spotless/java-thinkAfCod.license | 2 +- .../main/java/io/optimism/HildrBatcher.java | 6 ++-- .../batcher/compressor/Compressor.java | 35 ++++++++++--------- .../batcher/compressor/CompressorFactory.java | 4 +-- .../batcher/compressor/Compressors.java | 4 +-- .../optimism/batcher/compressor/Config.java | 4 +-- .../batcher/compressor/RatioCompressor.java | 6 ++-- .../batcher/compressor/ShadowCompressor.java | 4 +-- .../ex/CompressorFullException.java | 6 ++-- 10 files changed, 37 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index f587b459..15b085a7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ build .vscode */logs *.gz - +*.log diff --git a/config/spotless/java-thinkAfCod.license b/config/spotless/java-thinkAfCod.license index 6e501cb3..8324316c 100644 --- a/config/spotless/java-thinkAfCod.license +++ b/config/spotless/java-thinkAfCod.license @@ -1,5 +1,5 @@ /* - * Copyright $YEAR q315xia@163.com + * Copyright q315xia@163.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with diff --git a/hildr-batcher/src/main/java/io/optimism/HildrBatcher.java b/hildr-batcher/src/main/java/io/optimism/HildrBatcher.java index da5a1255..ccfec44c 100644 --- a/hildr-batcher/src/main/java/io/optimism/HildrBatcher.java +++ b/hildr-batcher/src/main/java/io/optimism/HildrBatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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) { diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressor.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressor.java index 45260f68..fc0bb54d 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressor.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressor.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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 - } diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/CompressorFactory.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/CompressorFactory.java index df2fdd06..d6554f2e 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/CompressorFactory.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/CompressorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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 {} diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressors.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressors.java index 4c070f65..5adbb4fe 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressors.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Compressors.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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 { diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Config.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Config.java index 4bd234ba..f1b4fb66 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Config.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/Config.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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. diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/RatioCompressor.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/RatioCompressor.java index 8ab888f8..a4fb932f 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/RatioCompressor.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/RatioCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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 diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ShadowCompressor.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ShadowCompressor.java index 3c06fb1e..e2f8eac0 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ShadowCompressor.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ShadowCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * 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 { diff --git a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ex/CompressorFullException.java b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ex/CompressorFullException.java index 99321c13..27f9582a 100644 --- a/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ex/CompressorFullException.java +++ b/hildr-batcher/src/main/java/io/optimism/batcher/compressor/ex/CompressorFullException.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 q315xia@163.com + * Copyright q315xia@163.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with @@ -17,11 +17,11 @@ package io.optimism.batcher.compressor.ex; /** - * if the compressor is full and no more data should be written or the compressor is known to be + * If the compressor is full and no more data should be written or the compressor is known to be * full. * * @author thinkAfCod - * @since 2023.07 + * @since 0.1.1 */ public class CompressorFullException extends RuntimeException {