下载此文档

javastruct关于java结构体.doc


文档分类:IT计算机 | 页数:约5页 举报非法文档有奖
1/5
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/5 下载此文档
文档列表 文档介绍
javastruct()关于java结构体javastruct A library to treat java objects asC structs. Project Home Downloads Wiki Issues Source Search for HowToUseJavaStruct This page explains how to use JavaStruct library. Featured , Phase-Implementation Updated Feb 4, 2010 by mda...@ Introduction Struct classes can be used to greatly work protocol codes of Java applications when working with embedded devices and other applications which uses C style structs. Instead of manually encoding and decoding messages, JavaStruct allows programmers to treat java classes asc structs. JavaStruct uses Java 5 annotations to mark Classes and fields as structs. JavaStruct is not the first attempt to provide struct like functionality, Jean-Marie Dautelle's Javolution library also has an excellent struct implementation. But instead of using special classes in Javolution, POJO approach is preferred JavaStruct. General usage JavaStruct fa ? ade class is used to pack and unpack struct classes. Below isa simple unit test method for checking a struct class. Struct fields hasan order value, because Java JVM specification does not tell anything about order of the class members. They are ordered as their appearance in Sun's implementation but it differs on other JVM's. So every Struct field has to supply an order value. ***@StructClass public class Foo { ***@StructField ( order =0) public byte b; ***@StructField ( order =1) public int i;} try { // Pack th

javastruct关于java结构体 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数5
  • 收藏数0 收藏
  • 顶次数0
  • 上传人fy5186fy
  • 文件大小57 KB
  • 时间2017-02-19