All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.licensing.FileLicenseSink Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package com.alachisoft.ncache.licensing;

/**
 * ***********************************************************************
 * Author: Hasan Khan Date created: 06-05-2008
 * 

* Modified By: Last modified by: Date modified: * /************************************************************************ */ //C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java: //#if NCPEX //#else //#endif public class FileLicenseSink implements ILicenseSink { private String file; public FileLicenseSink(String file) { this.file = file; } //C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java: ///#region ILicenseSink Members public final java.util.ArrayList Load() { // java.io.File info = new java.io.File(file); // if (info.exists() && info.length() > 0) // { ////C# TO JAVA CONVERTER NOTE: The following 'using' block is replaced by its Java equivalent: //// using (FileStream stream = File.OpenRead(file)) // FileStream stream = File.OpenRead(file); // try // { // BinaryFormatter formatter = new BinaryFormatter(); // java.util.ArrayList licenses = (java.util.ArrayList) formatter.deserialize(stream); // return licenses; // } // finally // { // stream.dispose(); // } // } // else // { return new java.util.ArrayList(); // } } public final void Dump(java.util.ArrayList licenses) { //C# TO JAVA CONVERTER NOTE: The following 'using' block is replaced by its Java equivalent: // using (FileStream stream = File.OpenWrite(file)) // FileStream stream = File.OpenWrite(file); // try // { // BinaryFormatter formatter = new BinaryFormatter(); // formatter.serialize(stream, licenses); // } // finally // { // stream.dispose(); // } } //C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java: ///#endregion }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy