Solved

java to c# conversion

Posted on 2006-07-11
5
898 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

763 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