File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 8836
    
    7

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method ByteBuffer.rewind()
 
Similar Threads
Generic Interfaces
JSP problem.
HashMap problem
How to check given field whether primitive or user defined
Forcing Input With The Scanner Class