Pessoal estou usando RMI, para serializar uma digital, e depois diserializar, mas na verdade eu gostaria de usar JSF / Web Service…
Alguém poderia da uma dica sobre isso !?
Trata-se de um Sistema de Biométria !
private byte[] serializar(Template digital) throws IOException {
byte[] buf = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = null;
try {
out = new ObjectOutputStream(baos);
out.writeObject(digital);
buf = baos.toByteArray();
} finally {
out.close();
baos.close();
}
return buf;
}
private Template deserializar(byte[] digital) throws IOException {
Template template = null;
ByteArrayInputStream bais = new ByteArrayInputStream(digital);
ObjectInputStream ois = null;
try {
ois = new ObjectInputStream(bais);
template = (Template) ois.readObject();
} catch (ClassNotFoundException e) {
getLogger().error(e.getMessage());
} finally {
bais.close();
ois.close();
}
return template;
}