Socket收发数据

来源:互联网 发布:阿里云价格计算器不准 编辑:程序博客网 时间:2024/05/23 15:43

Client write

server

Client read

字节数

writeByte()

UnsignedByte

readUnsignedByte()

1

writeLengthString()

String

readString()

 

writeByte()

Byte

readByte()

1

writeUnsignedInt

UnsignedInt

readUnsignedInt()

4

writeShort

UnsignedShort

readUnsignedShort

2

 

Bytes

 

 

 

Float

 

 

 

Short

 

 

 

int

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

方法:返回类型

描述

字节数

 

readBoolean():Boolean

读取布尔型数据

1

 

readByte():int

读取一个字节数据

1

 

readDouble():Number

读取IEEE 754 双精度浮点数

8

 

readFloat():Number

读取IEEE 754 单精度浮点数

4

 

readInt():int

读取32位整数

4

 

readObject():*

读取AMF格式数据

N

 

readShort():int

读取16位整数

2

 

readUnsignedByte():uint

读取无符号字节

1

 

readUnsignedInt():uint

读取无符号32位整数

4

 

readUnsignedShort():uint

读取无符号16位整数

2

 

readUTF():String

读取UTF – 8字符串

n