{00 1D 80 01 00 00 00 2F 00 01 00 00 30 34 36 30 30 32 33 35 31 36 37 30 35 35 30 31 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00......}
由于缓冲区大小是1024 所以一次读取,得到的花括号内一共是byte[1024],但是实际我需要的并没有这么多,前4位00 1D 正是我要获取的真实的长度 001D = 30位,即:{00 1D 80 01 00 00 00 2F 00 01 00 00 30 34 36 30 30 32 33 35 31 36 37 30 35 35 30 31 03 }
但即使是这样,还是不符合我要取的格式,需要去掉空格,去掉花括号,很纳闷怎么会有个花括号,记得以前用socket接收流的时候直接File读取并不需要对花括号做处理的,想要的格式是这样的:
001D80010000002F000100003034363030323335313637303535303103
还请大虾给与指点~不胜感激~!