Solved

java to c# conversion

Posted on 2006-07-11
5
896 Views
Last Modified: 2008-03-17
I want to convert this java code into c# code in my java to csharp convertion project  i used JLCA 3.0 it gives some code which needs some manual debugging. The java code is given below,

BufferedWriter nbr = null;
try {
nbr = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(statusFile)));
} catch (FileNotFoundException fnfe)
0
Comment
Question by:Rahamathulla_J
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 63 total points
ID: 17079803
Hi Rahamathulla_J,
----------

depending on the filemode parameter which yoiu can set yourself you could try something like

StreamWriter sw  = null;
try
{
    StreamWriter sw = new StreamWriter(statusFile, FileMode.Open);
}
catch (FileNotFoundException ex)
{

}

----------
bruintje
share what you know, learn what you don't
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 62 total points
ID: 17086413
Try this option also:

using System.IO;

...

try
{
    using (StreamWriter writer = new StreamWriter(new BufferedStream(new FileStream(statusFile, FileMode.Open))))
    {
    }

}
catch (FileNotFoundException ex)
{
}

Bob
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question