From 264a7a963099fc932eee114b84ae2b0db12b4713 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 2 Dec 2021 22:27:08 -0800 Subject: [PATCH] Created Adapter#self(EventExecutor,FileHandle) to return instant handle reference --- core/src/main/java/com/riiablo/asset/Adapter.java | 4 ++++ core/src/main/java/com/riiablo/asset/loader/MusicLoader.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/riiablo/asset/Adapter.java b/core/src/main/java/com/riiablo/asset/Adapter.java index 71ac7193..cda3d394 100644 --- a/core/src/main/java/com/riiablo/asset/Adapter.java +++ b/core/src/main/java/com/riiablo/asset/Adapter.java @@ -18,6 +18,10 @@ public abstract class Adapter { return type; } + public Future self(EventExecutor executor, F handle) { + return executor.newSucceededFuture(handle); + } + public abstract int defaultBufferSize(F handle); public abstract Future stream(EventExecutor executor, F handle, int bufferSize); public abstract Future buffer(EventExecutor executor, F handle, int offset, int length); diff --git a/core/src/main/java/com/riiablo/asset/loader/MusicLoader.java b/core/src/main/java/com/riiablo/asset/loader/MusicLoader.java index 527ac9e6..f6d7b958 100644 --- a/core/src/main/java/com/riiablo/asset/loader/MusicLoader.java +++ b/core/src/main/java/com/riiablo/asset/loader/MusicLoader.java @@ -21,7 +21,7 @@ public class MusicLoader extends AssetLoader { F handle, Adapter adapter ) { - return super.ioAsync(executor, assets, asset, handle, adapter); + return adapter.self(executor, handle); } @Override