@@ -281,63 +281,20 @@ public static byte[] fileLoadToProgress(File file, Consumer<ProgressWriter.Write
281281
282282 /**
283283 * リソースフォルダからデータを抽出
284- * {@link #resourceExtracted}を利用してください
285284 *
286285 * @param clazz リソースフォルダのクラス
287286 * @param path リソースパス
288287 * @return InputStream
289288 */
290289 @ Nullable
291- @ Deprecated
292290 public static InputStream resourceExtractor (@ NotNull Class <?> clazz , @ NotNull String path ) {
293- try {
294- return resourceBufferedExtracted (clazz , path );
295- } catch (IOException e ) {
296- throw new RuntimeException (e );
297- }
298- }
299-
300- /**
301- * リソースフォルダからデータを抽出
302- *
303- * @param clazz リソースフォルダのクラス
304- * @param path リソースパス
305- * @return InputStream
306- */
307- public static InputStream resourceExtracted (@ NotNull Class <?> clazz , @ NotNull String path ) throws IOException {
308- if (path .startsWith ("/" )) path = path .substring (1 );
309-
310- try (InputStream stream = clazz .getResourceAsStream ("/" + path )) {
311- if (stream != null )
312- return stream ;
313- }
314-
315- try (InputStream stream = ClassLoader .getSystemResourceAsStream (path )) {
316- if (stream != null )
317- return stream ;
318- }
319-
320- return null ;
321- }
291+ if (path .startsWith ("/" ))
292+ path = path .substring (1 );
322293
323- /**
324- * リソースフォルダからデータを抽出(バッファ)
325- *
326- * @param clazz リソースフォルダのクラス
327- * @param path リソースパス
328- * @return InputStream
329- * @throws IOException 例外
330- */
331- @ Nullable
332- public static InputStream resourceBufferedExtracted (@ NotNull Class <?> clazz , @ NotNull String path ) throws IOException {
333- try (InputStream stream = resourceExtracted (clazz , path )) {
334- if (stream != null ) {
335- try (InputStream bufStream = new BufferedInputStream (stream )) {
336- return bufStream ;
337- }
338- }
339- }
340- return null ;
294+ InputStream stream = clazz .getResourceAsStream ("/" + path );
295+ if (stream == null )
296+ stream = ClassLoader .getSystemResourceAsStream (path );
297+ return stream != null ? new BufferedInputStream (stream ) : null ;
341298 }
342299
343300 /**
0 commit comments