Results 1 to 2 of 2
  1. #1
    oregon is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default how to set the value of BUFFER SIZE

    how to set the value of BUFFER_SIZE ?
    Java Code:
    int bytesRead = 0;
    byte [] buffer= new byte[BUFFER_SIZE]
    bytesRead = inStream.read(buffer, 0, BUFFER_SIZE);
    while(bytesRead !=-1){
        outStream.write(buffer, 0, bytesRead);
        bytesRead = inStream.read(buffer, 0, BUFFER_SIZE);
    }
    thanks

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    It depends on the memory constraints on your system and if the low-level I/O like TCP/IP uses buffer you might have to be tandem with that. On average local system I/O 4k to 8k would be the 'common sense' size.

Similar Threads

  1. [SOLVED] Save the current buffer to file
    By Azndaddy in forum New To Java
    Replies: 2
    Last Post: 03-29-2008, 08:46 AM
  2. Replies: 0
    Last Post: 03-11-2008, 01:25 PM
  3. Trouble with Buffer Sizing
    By Jeff in forum New To Java
    Replies: 3
    Last Post: 02-07-2008, 02:43 PM
  4. Http Buffer issue... chunked?
    By jlew in forum Networking
    Replies: 1
    Last Post: 11-04-2007, 06:45 PM
  5. Help with String Buffer
    By mathias in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •