Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception type and other util #42

Merged
merged 2 commits into from
Aug 16, 2023
Merged

Conversation

thinkAfCod
Copy link
Collaborator

exception type and util

@thinkAfCod
Copy link
Collaborator Author

#37

*
* @author thinkAfCod
* @since 0.1.1
*/
public class CompressorFactory {
public class RandomUtil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也不需要,依赖的库里面有

* @param channelId channelId
* @param frameNumber channel frame number
*/
public record TxData(byte[] data, byte[] channelId, int frameNumber) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个node里面有吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是frame变了一个形式,可直接使用Frame,已移除

* either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

包名不要缩写,另外exception不用都放一块,除非是会共用的

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,这个是公共的,不同的包内都会使用

if (p.length > avail) {
readLen = avail;
}
System.arraycopy(data, pos, p, 0, readLen);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以用arrayUtils或者arrays简化下代码吧,你看下node里面的batches

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里需要把数据填充到参数里的byte[]里。
ArrayUtils和Arrays工具都是返回一个新创建的数组,没办法替换System.arraycopy这个操作。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy应该也有工具方法吧

@GrapeBaBa GrapeBaBa merged commit af7c08e into optimism-java:main Aug 16, 2023
1 check passed
@thinkAfCod thinkAfCod deleted the exception branch December 5, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants