Pro Java 7 NIO.2 by Anghel Leonard
Author:Anghel Leonard [Leonard, Anghel]
Language: eng
Format: epub, pdf
ISBN: 9781430240112
Publisher: Apress
Published: 2011-11-28T05:00:00+00:00
Figure 7-3 Java buffer representation (c)
Next, suppose that we read 2 bytes of data into our buffer. The 2 bytes of data go into the buffer starting at position 0. Therefore, the first 2 bytes are filled and the position goes to the third byte, as shown in Figure 7-4.
Figure 7-4 Java buffer representation (d)
Continuing with a second read, another 3 bytes go into the buffer. The position is increased to 5 (slot 6), as you can see in Figure 7-5.
Figure 7-5 Java buffer representation (e)
At this point, suppose that we are not reading into the buffer anymore and want to write from the buffer. To do this, we first need to call the flip() method before we write any bytes. This will set the limit to the current position, and set the position to 0. After the flip, the buffer appears as shown in Figure 7-6.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(16157)
The Mikado Method by Ola Ellnestam Daniel Brolund(13440)
Hello! Python by Anthony Briggs(13233)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(12381)
Dependency Injection in .NET by Mark Seemann(12244)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(10999)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(10856)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10540)
Grails in Action by Glen Smith Peter Ledbrook(10315)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(10264)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(9587)
Hit Refresh by Satya Nadella(9040)
Kotlin in Action by Dmitry Jemerov(9004)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8694)
The Kubernetes Operator Framework Book by Michael Dame(8488)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8309)
Robo-Advisor with Python by Aki Ranin(8262)
Practical Computer Architecture with Python and ARM by Alan Clements(8234)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8203)