Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

java to c# conversion

Posted on 2006-07-11
5
Medium Priority
?
916 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
2 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 252 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 248 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

877 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