title: Socket input stream doesn't read fragment by fragment
body: <p>I have problem in my app, I read from socket with ip=192.168.0.3 and port =502. Another program write messages to that port fragment by fragment ( mac fragmnet length is 205 bytes) and I need to read that messages fragment by fragment. But when I wrote this I get all fragments in one big. </p>
  
  <pre><code>boolean last=false;
                  int numberFragment=0;
                  while (((!last))  ) {
  
                      numberReceived = socketInputStream.read(buffer);
                      numberFragment++;
                      tempBuffer = new byte[numberReceived];
                      ByteBuffer baferce = ByteBuffer.wrap(tempBuffer);
                      baferce.put(buffer, 0, numberReceived);
                      //System.out.println("RECEIVED="+(new String(tempBuffer)));
                      last=ResponseFragmentCheck.IsLastFragment(tempBuffer, numberFragment);
                      System.out.println("LAST ="+last);
  
                      PrintBytesArray(tempBuffer);
                      received.add(tempBuffer);
                  }
  </code></pre>
  
  <p>Is there any way i Java to read fragment by fragment ?</p>