php
pack() 编码
unpack()先解成编码 不懂java
http://blog.csdn.net/CharlesYY/archive/2005/12/31/566775.aspx

解决方案 »

  1.   

    java我略懂一二,就是php不懂,也看不懂pack的文档,所以来问
      

  2.   

    C ByteBufferN Int Buffer
      

  3.   

    是这个吗?
    public class A{
    public static void main(String[] argv){
    byte[] array = "123456abc".getBytes();
    for(byte b:array){
    System.out.println("byte:" + b);
    System.out.println("char:" + new String(new byte[]{b}));
    System.out.println("long:" + new Byte(b).longValue());
    System.out.println();
    }
    }
    }
      

  4.   

    不需要php是弱类型语言,所以提供了pack和unpack用于与强类型数据结构交换数据
    pack('C', 1 ) 将数值1转换为无符号字符 unsigned char
    pack('N', 9 ) 将数值9转换为无符号短整形 unsigned short而java是强类型语言,数据在使用时都有严格的类型声明