Tag: datainputstream

Swift将字节数组转换为整数

你好,我是新的swift,并希望将一个字节数组转换为几个整数。 我已经用Java编写了工作代码,但我不太确定如何快速完成工作 byte[] codeData = Base64.decode(codeDataBase64, 0); ByteArrayInputStream bais = new ByteArrayInputStream(codeData); DataInputStream dis = new DataInputStream(bais); byte version = dis.readByte(); if (version == 1) { int anID = dis.readInt(); int anotherID = dis.readInt(); byte[] TK = new byte[512]; int readTK = dis.read(TK); if (readTK == TK.length) { Log.e("photoConnect success", "anID=" + anID + ", […]