Skip to content

Commit 8e541c8

Browse files
committed
1.59
1 parent 5bc2731 commit 8e541c8

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package dev.felnull.fnjl;
22

33
public class FNJLBuildIn {
4-
protected static final String VERSION = "1.58";
4+
protected static final String VERSION = "1.59";
55
}

common/src/main/java/dev/felnull/fnjl/util/FNDataUtil.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,29 @@ public static byte[] fileLoadToProgress(File file, Consumer<ProgressWriter.Write
289289
@Nullable
290290
public static InputStream resourceExtractor(@NotNull Class<?> clazz, @NotNull String path) {
291291
if (path.startsWith("/")) path = path.substring(1);
292-
293292
InputStream stream = clazz.getResourceAsStream("/" + path);
294293
if (stream == null) stream = ClassLoader.getSystemResourceAsStream(path);
295-
return stream != null ? new BufferedInputStream(stream) : null;
294+
return stream;
295+
}
296+
297+
/**
298+
* リソースフォルダからデータを抽出(バッファ)
299+
*
300+
* @param clazz リソースフォルダのクラス
301+
* @param path リソースパス
302+
* @return InputStream
303+
* @throws IOException 例外
304+
*/
305+
@Nullable
306+
public static InputStream resourceBufferedExtractor(@NotNull Class<?> clazz, @NotNull String path) throws IOException {
307+
try (InputStream stream = resourceExtractor(clazz, path)) {
308+
if (stream != null) {
309+
try (InputStream bufStream = new BufferedInputStream(stream)) {
310+
return bufStream;
311+
}
312+
}
313+
}
314+
return null;
296315
}
297316

298317
/**

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fnjl_group=dev.felnull
22
fnjl_name=felnull-java-library
3-
fnjl_version=1.58
3+
fnjl_version=1.59
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.felnull.fnjln;
22

33
public class FNJLNBuildIn {
4-
protected static final String VERSION = "1.58";
4+
protected static final String VERSION = "1.59";
55

66
protected static final int NATIVE_LIBRARY_VERSION = 1;
77
}

0 commit comments

Comments
 (0)