473,498 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Java to .Net conversion - problem with InputStream

DM
Hello.

Originally I post this message to microsoft.public.dotnet.general,
but I was advised thath this group is more suitable so I resent it here:

I'm trying to port Java application to C#. During
my effort I enoucntered a problem for which I can't find
an easy solution.
Ad rem: The program I'm trying to port uses available()
method of Java's InputStream. This method returns numer of bytes
available for reading without blocking the procces. Unfortunately
System.IO.Stream does not provide similar functionality. Does
anyone know any solution, workaround for this problem??

Thank you.

--
DM

Nov 16 '05 #1
1 5610
DM <is***@belial.pl.eu.org> wrote:
Originally I post this message to microsoft.public.dotnet.general,
but I was advised thath this group is more suitable so I resent it here:

I'm trying to port Java application to C#. During
my effort I enoucntered a problem for which I can't find
an easy solution.
Ad rem: The program I'm trying to port uses available()
method of Java's InputStream. This method returns numer of bytes
available for reading without blocking the procces. Unfortunately
System.IO.Stream does not provide similar functionality. Does
anyone know any solution, workaround for this problem??


I'd avoid using any equivalent anyway, to be honest - available()
should almost always be avoided in Java too, IME. It's unreliable and
causes problems.

Do you particularly need to read without blocking? If so, would reading
asynchronously be good enough? If so, look at Stream.BeginRead.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
336
by: DM | last post by:
Hello. I'm trying to port Java application to C#. During my effort I enoucntered a problem for which I can't find an easy solution. Ad rem: The program I'm trying to port uses available()...
1
2329
by: iksrazal | last post by:
Hi all, I've been struggling to make this command work from Java: /usr/bin/mysql c4 --user=root --password=mypass -e "source /home/crissilva/c4.sql" Works fine as shown when run from the...
2
7976
by: jordan | last post by:
I am a longtime C++ programmer and I'm trying to understand how I would phrase a common idiom in Java. Consider the following program in C++, which reads tokens either from an istringstream (in...
0
1871
by: snkssa | last post by:
Hi, I got the following error while building an application with ant. please can you give the solution or reason why it is failing? Thank you create_zip_linux: ...
0
3116
by: VeeraLakshmi | last post by:
I am doing a project for internet control using Java,PHP and MySql.All sites should go through the proxy server only.We are giving access rights as allow or deny to the sites.If we type the...
0
2557
by: ErikaW | last post by:
Hi all, I've tried to google this but could not find a clear solution. I have a Web application developed in JDevloper using mostly html and Javascript. I have a pre-defined PDF form which I merge...
1
4438
by: henrymania | last post by:
Am writing a code for database backup....by backupservlet is as given below i get the following exception
5
7701
by: PatlaDJ | last post by:
Java SAX parser, please need a clue how to get the raw XML code of the currently parsing event... needed for logging, debugging purposes. Here's and example, letting me clarify exactly what i...
0
10705
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.