-
Help with InputStream
I'm having some problems with socketprogramming.
When I'm trying to read from the socket I can only read 8000 chars. Then
I have to loop and read again.
Is there a restriction or can I do it in another way.
I use the inputstream.availible() method to termin how much to read but it
always returns 8192 bytes even when there are more bytes to read therefor
I have to wait until the inputstream is full again (8192) so this is basically
a performance problem.
-
Re: Help with InputStream
Hi,
You haven't mentioned whether you are Buffering or Not and What Streams you
are using ?
You can consider the following things:-
1) Buffering Data Output & Input
2) Reading Chunks of Data using read(byte []) and using the return value
to find out data is still there or not.
3) flush() on the Server part
Hope this helps
Regards
Rajkamal
"Fredrik" <fredrik.ahlfeldt@administrator.se> wrote:
>
>I'm having some problems with socketprogramming.
>When I'm trying to read from the socket I can only read 8000 chars. Then
>I have to loop and read again.
>Is there a restriction or can I do it in another way.
>I use the inputstream.availible() method to termin how much to read but
it
>always returns 8192 bytes even when there are more bytes to read therefor
>I have to wait until the inputstream is full again (8192) so this is basically
>a performance problem.
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks