用 BinaryWrite 写入数据流  比如 write(int32) write(int16) 写入结果都是高位在后..低位在前....有没有办法 反过来呢?  比如 258 他会写成 02 01     ..
因为用c#生成数据要在j2me中用。...java读取流和这个相反..谢谢

解决方案 »

  1.   

    有没有方法可以简单的反过来..非用 write(byte) 方法反过来 
      

  2.   

    byte[] byResponse.BinaryWrite(by);
      

  3.   

            public static void WriteShort(short a,BinaryWriter w)
            {
                w.Write(((byte)((a>>8) & 0xff)));
                w.Write(((byte)(a&0xff)));
            }
            public static void WriteInt(int a, BinaryWriter w)
            {
                w.Write((byte)((a>>24)&0xff));
                w.Write((byte)((a >> 16) & 0xff));
                w.Write((byte)((a >> 8) & 0xff));
                w.Write((byte)((a) & 0xff));
            }
    只能如此了。..哎