Add missing methods
This commit is contained in:
parent
a4deeee6d5
commit
a11ce4a646
@ -1,5 +1,6 @@
|
||||
package it.cavallium.dbengine.client;
|
||||
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
public interface CompositeDatabase {
|
||||
@ -9,4 +10,6 @@ public interface CompositeDatabase {
|
||||
Mono<CompositeSnapshot> takeSnapshot() throws SnapshotException;
|
||||
|
||||
Mono<Void> releaseSnapshot(CompositeSnapshot snapshot) throws SnapshotException;
|
||||
|
||||
ByteBufAllocator getAllocator();
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ public class LLUtils {
|
||||
}
|
||||
*/
|
||||
|
||||
public static ByteBuf convertToDirectByteBuf(AbstractByteBufAllocator alloc, ByteBuf buffer) {
|
||||
public static ByteBuf convertToDirectByteBuf(ByteBufAllocator alloc, ByteBuf buffer) {
|
||||
ByteBuf result;
|
||||
ByteBuf directCopyBuf = alloc.buffer(buffer.capacity(), buffer.maxCapacity());
|
||||
directCopyBuf.writeBytes(buffer, 0, buffer.writerIndex());
|
||||
@ -319,6 +319,12 @@ public class LLUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ByteBuf fromByteArray(ByteBufAllocator alloc, byte[] array) {
|
||||
ByteBuf result = alloc.buffer(array.length);
|
||||
result.writeBytes(array);
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ByteBuf readDirectNioBuffer(ByteBufAllocator alloc, ToIntFunction<ByteBuffer> reader) {
|
||||
var buffer = readNullableDirectNioBuffer(alloc, reader);
|
||||
|
Loading…
Reference in New Issue
Block a user