swift中的DataInputStream readInt()函数

时间:2017-07-12 12:10:48

标签: java ios swift datainputstream

在Swift>中是否存在等效的Java代码? 3?

int i = LibUtils.StreamReadInt(is);

byte[] aa = new byte[i];


is.read(aa, 0, i);

这里,StreamReadInt的代码是

public static int StreamReadInt(InputStream st) {

int i = 0;
    try {
        DataInputStream ds = new DataInputStream(st);
        i = ds.readInt();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return i;
}

0 个答案:

没有答案