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)
buffer.read(cond1,limit1,limit2)
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.