/* (non-Javadoc)
* @see org.objectweb.joram.shared.stream.Streamable#readFrom(java.io.InputStream)
*/
public void readFrom(InputStream is) throws IOException {
principal = StreamUtil.readStringFrom(is);
ByteArrayInputStream bais = null;
ObjectInputStream ois = null;
try {
byte[] subByte = StreamUtil.readByteArrayFrom(is);
bais = new ByteArrayInputStream(subByte);
ois = new ObjectInputStream(bais);
try {
subject = (Subject) ois.readObject();
} catch (ClassNotFoundException e) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR, "EXCEPTION:: readFrom", e);
throw new IOException(e.getMessage());
}
} finally {
try {
ois.close();
} catch (IOException exc) {}
try {
bais.close();
} catch (IOException exc) {}
}
}