< prev index next >
src/java.base/share/classes/sun/nio/fs/NativeBuffers.java
Print this page
*** 105,122 ****
}
// Otherwise replace a smaller one in the cache if such exists
for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
NativeBuffer existing = buffers[i];
if (existing.size() < buffer.size()) {
! existing.cleaner().clean();
buffers[i] = buffer;
return;
}
}
// free it
! buffer.cleaner().clean();
}
/**
* Copies a byte array and zero terminator into a given native buffer.
*/
--- 105,122 ----
}
// Otherwise replace a smaller one in the cache if such exists
for (int i=0; i<TEMP_BUF_POOL_SIZE; i++) {
NativeBuffer existing = buffers[i];
if (existing.size() < buffer.size()) {
! existing.cleanable().clean();
buffers[i] = buffer;
return;
}
}
// free it
! buffer.cleanable().clean();
}
/**
* Copies a byte array and zero terminator into a given native buffer.
*/
< prev index next >