Solved

java to c# conversion

Posted on 2006-07-11
5
886 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now