my dog learned polymorphism*
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
Author

method ByteBuffer.rewind()

henry akoma
Greenhorn

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:

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

Joined: Oct 29, 2001
Posts: 8710
    
    6

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
Consider Paul's rocket mass heater.
 
subject: method ByteBuffer.rewind()
 
Similar Threads
Generic Interfaces
JSP problem.
Forcing Input With The Scanner Class
How to check given field whether primitive or user defined
HashMap problem