I am aware that flip() set the current buffer position to 0 and set the limit to the previous buffer position whereas rewind() just set the current buffer position to 0.
In the following code, either I use rewind() or flip() i get the same result.
byte b = 127;
bb.put(b);
bb.rewind();//or flip();
System.out.println(bb.get());
bb.rewind();// or flip();
System.out.println(bb.get());
Could you provide me with a real example where the difference of these 2 methods really matters? Thanks in advance.