Java in a Nutshell, 5th Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Java in a Nutshell, 5th Edition [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


MappedByteBufferjava.nio

Java 1.4comparable

This
class
is a ByteBuffer that represents a memory-mapped
portion of a file. Create a MappedByteBuffer by
calling the map( ) method of a
java.nio.channels.FileChannel. All
MappedByteBuffer buffers are
direct
buffers.

isLoaded( ) returns a hint as to whether the
contents of the buffer are currently in primary memory (as opposed to
resident on disk). If it returns TRue, then
operations on the buffer will probably execute very quickly. The
load( )
method requests (but does not require) that the operating system load
the buffer contents into primary memory. It is not guaranteed to
succeed. For buffers that are mapped in read/write mode, the
force( ) method outputs any changes that have been
made to the buffer contents to the underlying file. If the file is on
a local device, then it is guaranteed to be updated before
force( ) returns. No such guarantees can be made
for mapped network files.

Note that the underlying file of a
MappedByteBuffer may be shared, which means that
the contents of such a buffer can change asynchronously if the
contents of the file are modified by another thread or another
process (such asynchronous changes to the underlying file may or may
not be visible through the buffer; this is a platform-dependent, and
should not be relied on). Furthermore, if another thread or process
truncates the file, some or all of the elements of the buffer may no
longer map to any content of the file. An attempt to read or write
such an inaccesible element of the buffer will cause an
implementation-defined exception, either immediately or at some later
time.


Figure 13-10. java.nio.MappedByteBuffer

public abstract class

MappedByteBuffer extends ByteBuffer {
// No Constructor
// Public Instance Methods
public final MappedByteBuffer

force ( );
public final boolean

isLoaded ( );
public final MappedByteBuffer

load ( );
}


Returned By


java.nio.channels.FileChannel.map( )


    / 1191