File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes method ByteBuffer.rewind() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "method ByteBuffer.rewind()" Watch "method ByteBuffer.rewind()" New topic

method ByteBuffer.rewind()

henry akoma

Joined: May 17, 2005
Posts: 21
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:

ByteBuffer buff=ByteBuffer.allocate(1024);

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

Joined: Oct 29, 2001
Posts: 9189

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: method ByteBuffer.rewind()
It's not a secret anymore!