Created Adapter#self(EventExecutor,FileHandle) to return instant handle reference

This commit is contained in:
Collin Smith 2021-12-02 22:27:08 -08:00
parent ffad38ad76
commit 264a7a9630
2 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,10 @@ public abstract class Adapter<F extends FileHandle> {
return type;
}
public Future<? extends F> self(EventExecutor executor, F handle) {
return executor.newSucceededFuture(handle);
}
public abstract int defaultBufferSize(F handle);
public abstract Future<InputStream> stream(EventExecutor executor, F handle, int bufferSize);
public abstract Future<ByteBuf> buffer(EventExecutor executor, F handle, int offset, int length);

View File

@ -21,7 +21,7 @@ public class MusicLoader extends AssetLoader<Music> {
F handle,
Adapter<F> adapter
) {
return super.ioAsync(executor, assets, asset, handle, adapter);
return adapter.self(executor, handle);
}
@Override