Help with InputStream


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help with InputStream

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



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center