This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "java nio" Watch "java nio" New topic

java nio

bagaria kushal

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: 199
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

also you can extract the specific part of data from buffer using utilities like subString,indexOf.
Have you checked out Aspose?
subject: java nio
It's not a secret anymore!