简体   繁体   English

Java 或 C++ 等同于 Preon?

[英]Java or C++ equivalents to Preon?

Preon is a Java library meant for creating binary codecs: you simply place annotations in a class' data members regarding their correspondence with bit fields (eg number of bits to use for certain field) and, based on such class, the library builds a Codec object that is able to create instances of the class reading their data from a binary input stream. Preon是一个 Java 库,用于创建二进制编解码器:您只需将注释放在类的数据成员中,了解它们与位字段的对应关系(例如,用于某个字段的位数),并且基于此类 class,该库构建一个编解码器object 能够创建 class 的实例,从二进制输入 stream 读取其数据。

Due to licensing issues (it is distributed under GPL), I cannot use it.由于许可问题(它在 GPL 下分发),我无法使用它。

Are there any libraries with equivalent or similar functionality, either in Java or in C++?在 Java 或 C++ 中是否有任何具有等效或类似功能的库?

looking at the license page, the preon library is "GNU General Public License, version 2, with the Classpath Exception ", which is important.查看许可证页面,preon 库是“GNU General Public License, version 2, with the Classpath Exception ”,这很重要。 that allows you to use the library in binary form without your application also being GPL.这允许您以二进制形式使用该库,您的应用程序也不是 GPL。

Take a look at Java Binary Block Parser library , it allows to make bit field parsing and mapping to class fields看看Java Binary Block Parser library ,它允许对位字段进行解析和映射到 class 字段

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM