This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes java nio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "java nio" Watch "java nio" New topic
Author

java nio

bagaria kushal
Greenhorn

Joined: Mar 29, 2011
Posts: 19
Please tell me how we can read line from bytebuffer
Ankit Tripathi
Ranch Hand

Joined: Oct 17, 2009
Posts: 198
Hi Bagaria,Welcome to JavaRanch Community.....

ByteBuffer class uses channels like "FileChannel" to read data from files.
Have you seen methods available ByteBuffer and FileChannel classes?
I think there is no readLine() method available.
But you can do similar by allocating a buffer size and than setting initial offset and capacity
like-


also you can extract the specific part of data from buffer using utilities like subString,indexOf.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java nio