45 |
final class MappedByteBufferImpl extends MappedByteBuffer |
final class MappedByteBufferImpl extends MappedByteBuffer |
46 |
{ |
{ |
47 |
boolean readOnly; |
boolean readOnly; |
|
RawData address; |
|
48 |
|
|
49 |
/** Posix uses this for the pointer returned by mmap; |
/** Posix uses this for the pointer returned by mmap; |
50 |
* Win32 uses it for the pointer returned by MapViewOfFile. */ |
* Win32 uses it for the pointer returned by MapViewOfFile. */ |
117 |
|
|
118 |
public ByteBuffer compact() |
public ByteBuffer compact() |
119 |
{ |
{ |
120 |
|
checkIfReadOnly(); |
121 |
|
mark = -1; |
122 |
int pos = position(); |
int pos = position(); |
123 |
if (pos > 0) |
if (pos > 0) |
124 |
{ |
{ |
128 |
position(count); |
position(count); |
129 |
limit(capacity()); |
limit(capacity()); |
130 |
} |
} |
131 |
|
else |
132 |
|
{ |
133 |
|
position(limit()); |
134 |
|
limit(capacity()); |
135 |
|
} |
136 |
return this; |
return this; |
137 |
} |
} |
138 |
|
|