读书人

short、int、long与byte其间的转换工具

发布时间: 2012-08-26 16:48:06 作者: rapoo

short、int、long与byte之间的转换工具类

public class FileHead {    /**版本*/    public static final int VERSION = 0x00000001;    /**头标志*/    public static final byte[] FLAG = {'T', 'E', 'S', 'T'};    /**压缩算法*/    public int compress = 0x00000003;}        //向文件中写头信息    static void t6(){        FileHead head = new FileHead();        OutputStream out = null;                head.compress = 0x04;                out.write(Utility.int2Byte(head.VERSION));        out.write(head.FLAG);        out.write(Utility.int2Byte(head.compress));    }

读书人网 >编程

热点推荐