Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method ByteBuffer.rewind()

 
henry akoma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
reading thru "thinking in java, 3rd ed." by bruce eckel, i came across this code in the New I/O topic, section on Converting data:

code:
......
ByteBuffer buff=ByteBuffer.allocate(1024);
.....
buff.rewind();

i have checked the java API and i could not find the method ByteBuffer.rewind().please, can anyone help me with the function of this method.

akoma henry
 
Joe Ess
Bartender
Posts: 9319
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One fundamental concept of object-oriented programming is that a subclass inherits functionality from its superclass. If you look at the API doc for java.nio.ByteBuffer, you'll see that it extends java.nio.Buffer. If you scroll past the Method Summary to the section titled "Methods inherited from class java.nio.Buffer" you'll see that rewind is declared in Buffer, with a handy link to the method documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic