Solved

java to c# conversion

Posted on 2006-07-11
5
905 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

617 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