private void verifyVersionInfo() throws IOException { String versionInfoPath = myExePath + ".version"; RandomAccessFile versionInfoStream = new RandomAccessFile(versionInfoPath, "rw"); try { myVersionInfo.resetOffsets(0); myVersionInfo.write(versionInfoStream); } finally { versionInfoStream.close(); } VersionInfo copy = new VersionInfo(); copy.read( new OffsetTrackingInputStream(new DataInputStream(new FileInputStream(versionInfoPath)))); }
private void saveVersionInfo() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); myVersionInfo.resetOffsets(0); myVersionInfo.write(new DataOutputStream(baos)); getVersionInfoResource().setBytes(baos.toByteArray()); }