Oh, geez, sorry. Yes, it is Java. I've been working with programs in both
Java and Javascript, and suddenly I got themmixed up. Sorry about that.
I am translating from Java and Javascript to .Net (don't ask me why, I am
just following orders from my boss) and these lines are giving me a hard
time, though they seem very simple.
Yes, you can safely assume I have the implementation for class
TheDataManager. What I interpret from this Java code is that the programmer
wants to serialize and save to disk a TheDataManager instance class. The
thing is that I am not 100% sure about it, so I don't know exactly what to
do. That's why I have been looking for the "literally equivalent" lines of
codes for the Java lines I posted here.
If you wouldn't mind, how would you write these lines, say in C# or VB.Net?
Thank you very much.
C
"Bob Grommes" wrote:
This isn't JavaScript. It's Java.
Assuming you have the source to TheDataManager class, it should be a pretty
straightforward conversion. What specifically do you have questions about?
--Bob
"Carlitos" <Ca******@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...I have researched a lot trying to get this. So as a last resource I will
have to ask here.
What would be the equivalent to the following javascript excerpt:
TheDataManager MyDMgr = new TheDataManager();
File MyDataFile = new File(strDataPath);
// Create a new file if and only if it doesn't already exist
boolean mNoFileExists = MyDataFile.createNewFile();
//new file was created
if ( mNoFileExists )
{
// Write out the data to disk using serialization
FileOutputStream fos = new FileOutputStream(MyDataFile);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(MyDMgr);
oos.close();
}