
Of memory then an attempt to access that region will not change the buffer'sĬontent and will cause an unspecified exception to be thrown either at the Instance of one of these kinds of buffers refers to an inaccessible region Support the creation of direct byte buffers from native code via JNI. An implementation of the Java platform may optionally In general it is best to allocate directīuffers only when they yield a measureable gain in program performance.Ī direct byte buffer may also be created by mapping a region of a fileĭirectly into memory. Primarily for large, long-lived buffers that are subject to the underlying It is therefore recommended that direct buffers be allocated Their impact upon the memory footprint of an application might not be The contents of directīuffers may reside outside of the normal garbage-collected heap, and so Theīuffers returned by this method typically have somewhat higher allocationĪnd deallocation costs than non-direct buffers. That is, it will attempt toĪvoid copying the buffer's content to (or from) an intermediate bufferīefore (or after) each invocation of one of the underlying operatingĪ direct byte buffer may be created by invoking the allocateDirect factory method of this class. Perform native I/O operations directly upon it. Given aĭirect byte buffer, the Java virtual machine will make a best effort to Methods for compacting, duplicating, and slicing a byte buffer.īyte buffers can be created either by allocation, which allocates space for the buffer'sĪ byte buffer is either direct or non-direct.

Which allow a byte buffer to be viewed as a buffer containing values of Sequences of bytes in a particular byte order Write values of other primitive types, translating them to and from

Methods that transfer contiguous sequences of bytes from a

Methods that transfer contiguous sequences of bytes from this buffer

This class defines six categories of operations upon
