我有一个功能
public static Object receviceSigAndData (Socket s) {
byte[] data = null;
try {
DataInputStream din2 = new DataInputStream(s.getInputStream());
int sig_len = 0;
sig_len = din2.readInt();
byte[] sig = new byte[sig_len];
din2.readFully(sig);
int data_len = 0;
data_len = din2.readInt();
data = new byte[data_len];
dsa.update(data);
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return (Object)data;
}
该函数返回一个对象,如果对象是字节数组,我如何将对象转换为byte[]
?
byte[] b = (?)receviceSigAndData (socket);
谢谢