![]() |
The Java Developers Almanac 1.4 |
|
e168. Determining If a ByteBuffer Is DirectA non-directByteBuffer is one where the contents are stored in
the normal memory. A direct ByteBuffer is one where the contents
are stored in some I/O device such as a disk drive or video board.
See also e158 Creating a ByteBuffer. ByteBuffer bbuf = ByteBuffer.wrap(new byte[10]);
boolean isDirect = bbuf.isDirect(); // false
bbuf = ByteBuffer.allocate(10);
isDirect = bbuf.isDirect(); // false
bbuf = ByteBuffer.allocateDirect(10);
isDirect = bbuf.isDirect(); // true
e167. Persisting Changes to a Memory-Mapped ByteBuffer e169. Reading from a Channel with a ByteBuffer e170. Writing to a Channel with a ByteBuffer e171. Writing and Appending a ByteBuffer to a File e172. Copying One File to Another
© 2002 Addison-Wesley. |