public final void packBookInformation(BookInformation object, String file) { try { Marshaller conversion = contextBookInformation.createMarshaller(); conversion.marshal(object, new FileOutputStream(file)); } catch (Exception exception) { System.out.println("An exception has occurred: " + exception.getMessage()); if (Constants.DEBUG) { exception.printStackTrace(); } } } public final void packBookInformationDetailed(BookInformationDetailed object, String file) { try { Marshaller conversion = contextBookInformationDetailed.createMarshaller(); conversion.marshal(object, new FileOutputStream(file)); } catch (Exception exception) { System.out.println("An exception has occurred: " + exception.getMessage()); if (Constants.DEBUG) { exception.printStackTrace(); } } } public final BookInformation unpackBookInformation(String file) { try { Unmarshaller conversion = contextBookInformation.createUnmarshaller(); return (BookInformation)conversion.unmarshal(new FileInputStream(file)); } catch (Exception exception) { System.out.println("An exception has occurred: " + exception.getMessage()); if (Constants.DEBUG) { exception.printStackTrace(); } } return null; } public final BookInformationDetailed unpackBookInformationDetailed(String file) { try { Unmarshaller conversion = contextBookInformationDetailed.createUnmarshaller(); return (BookInformationDetailed)conversion.unmarshal(new FileInputStream(file)); } catch (Exception exception) { System.out.println("An exception has occurred: " + exception.getMessage()); if (Constants.DEBUG) { exception.printStackTrace(); } } return null; }