Results 1 to 3 of 3

Thread: Buffer

  1. #1
    QPRocky is offline Member
    Join Date
    Jan 2009
    Rep Power

    Default Buffer


    I'm coding TCPClient and have question about buffer.
    How can I fill buffer with misc data (ie. bytes, chars, ints, strings)

  2. #2
    guneet singh is offline Member
    Join Date
    Jan 2009
    Rep Power


    i m not clear what u r saying ...
    well u can put any thing in buffer by...
    byte[] buffer=new byte[1024];
    while(any condition),limit1,limit2)

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power


    Look at SocketChannel and ByteBuffer. Note that ByteBuffer only deals with primitive types, such as char. You can not read a String from it directly. You can read a sequence of char and assemble them in a StringBuilder.

    Keep in mind that the server and the client must be in *complete* agreement about what is sent back and forth.

Similar Threads

  1. Non Allocating String Buffer
    By chrisdb89 in forum New To Java
    Replies: 5
    Last Post: 10-25-2008, 06:57 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. Help with String Buffer
    By mathias in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 06:52 AM
  5. how to set the value of BUFFER SIZE
    By oregon in forum Advanced Java
    Replies: 1
    Last Post: 08-06-2007, 03:16 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