Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkAfCod committed Jul 31, 2023
1 parent c0fa81a commit 6687b21
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ build
.vscode
*/logs
*.gz

*.log
2 changes: 1 addition & 1 deletion config/spotless/java-thinkAfCod.license
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions hildr-batcher/src/main/java/io/optimism/HildrBatcher.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {

Expand All @@ -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

}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,6 +20,6 @@
* Compressor Factory.
*
* @author thinkAfCod
* @since 2023.07
* @since 0.1.1
*/
public class CompressorFactory {}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,7 +20,7 @@
* Compressor create tool.
*
* @author thinkAfCod
* @since 2023.07
* @since 0.1.1
*/
public interface Compressors {

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,7 +24,7 @@
* ShadowCompressor class.
*
* @author thinkAfCod
* @since 2023.07
* @since 0.1.1
*/
public class ShadowCompressor implements Compressor {

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {

Expand Down

0 comments on commit 6687b21

Please sign in to comment.