Is there an equivalent of below Java code in in Swift > 3?
int i = LibUtils.StreamReadInt(is);
byte[] aa = new byte[i];
is.read(aa, 0, i);
here, the code for StreamReadInt
is
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;
}