DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Fredrik Guest

    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.



  2. #2
    Rajkamal Gopinath Guest

    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.
    >
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links