{"id":1338,"date":"2019-01-29T12:00:45","date_gmt":"2019-01-29T03:00:45","guid":{"rendered":"https:\/\/www.bold.ne.jp\/engineer-club\/?p=1338"},"modified":"2025-10-06T16:54:36","modified_gmt":"2025-10-06T07:54:36","slug":"java-reading-files","status":"publish","type":"post","link":"https:\/\/www.bold.ne.jp\/engineer-club\/java-reading-files","title":{"rendered":"Java\u3067\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u3059\u308b\u8d85\u5b9f\u8df5\u7684\u306a3\u3064\u306e\u65b9\u6cd5\u3010\u521d\u5fc3\u8005\u3067\u3082\u3067\u304d\u308b\u3011"},"content":{"rendered":"<p>Java\u304c\u8a95\u751f\u3057\u305f\u306e\u306f<span>1995<\/span>\u5e74\u3001<span>2019<\/span>\u5e74\u73fe\u5728\u3067\u306f<span>24<\/span>\u5e74\u307b\u3069\u306e\u6b74\u53f2\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u9577\u3044\u6b74\u53f2\u306e\u4e2d\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u3082\u5c11\u3057\u305a\u3064\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Java\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u306b\u306f\u3001<span>Java 11<\/span>\u306e\u6642\u70b9\u3067\u306f\u5927\u304d\u304f\u5206\u3051\u3066\u4ee5\u4e0b\u306e\u4e09\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u7279\u5fb4\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3067\u305c\u3072\u305d\u308c\u305e\u308c\u306e\u4f7f\u3044\u65b9\u3092\u8eab\u306b\u7740\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><strong>java.nio.file.Files\u3067\u8aad\u307f\u8fbc\u3080<\/strong><\/li>\n<li><strong>java.io.FileReader\/FileInputStream\u3067\u8aad\u307f\u8fbc\u3080<\/strong><\/li>\n<li><strong>java.nio.channels.FileChannel\u3067\u8aad\u307f\u8fbc\u3080<\/strong><\/li>\n<\/ul>\n<p>\u203b\u3053\u306e\u8a18\u4e8b\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3001<span>Java 11<\/span>\u306e\u74b0\u5883\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#JavaFiles\">\uff11\uff0e\u3010Java\u3011Files\u3067\u8aad\u307f\u8fbc\u3080<\/a><ul><li><a href=\"#-StringJava_11\">\uff11-\uff11\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092String\u306b\u3059\u308b\u3010Java 11\u4ee5\u964d\u3011<\/a><\/li><li><a href=\"#-StringListJava_7\">\uff11-\uff12\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092String\u306eList\u306b\u3059\u308b\u3010Java 7\u4ee5\u964d\u3011<\/a><\/li><li><a href=\"#-byteJava_7\">\uff11-\uff13\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092byte\u914d\u5217\u306b\u3059\u308b\u3010Java 7\u4ee5\u964d\u3011<\/a><\/li><li><a href=\"#-StreamJava_8\">\uff11-\uff14\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092Stream\u3067\u8aad\u307f\u8fbc\u3080\u3010Java 8\u4ee5\u964d\u3011<\/a><\/li><li><a href=\"#-Files\">\uff11-\uff15\uff0eFiles\u3092\u4f7f\u3046\u6642\u306f\u30e1\u30e2\u30ea\u4e0d\u8db3\u306b\u6c17\u3092\u4ed8\u3051\u3088\u3046<\/a><\/li><\/ul><\/li><li><a href=\"#JavaReaderInputStream\">\uff12\uff0e\u3010Java\u3011Reader\/InputStream\u3067\u8aad\u307f\u8fbc\u3080<\/a><ul><li><a href=\"#i\">\uff12-\uff11\uff0e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u884c\u305a\u3064\u8aad\u307f\u8fbc\u3080<\/a><\/li><li><a href=\"#i-2\">\uff12-\uff12\uff0e\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080<\/a><\/li><\/ul><\/li><li><a href=\"#JavaFileChannel\">\uff13\uff0e\u3010Java\u3011FileChannel\u3067\u8aad\u307f\u8fbc\u3080<\/a><ul><li><a href=\"#-Channel\">\uff13-\uff11\uff0eChannel\u3068\u306f\u901f\u5ea6\u91cd\u8996\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/a><\/li><li><a href=\"#-FileChannelReader\">\uff13-\uff12\uff0eFileChannel\u3068Reader\u306f\u4f7f\u3044\u65b9\u304c\u5168\u304f\u9055\u3046<\/a><\/li><li><a href=\"#-FileChannelByteBuffer\">\uff13-\uff13\uff0eFileChannel\u3068ByteBuffer\u3092\u4f7f\u3063\u3066\u307f\u308b<\/a><\/li><li><a href=\"#-FileChannel\">\uff13-\uff14\uff0eFileChannel\u3092\u4f7f\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc<\/a><\/li><\/ul><\/li><li><a href=\"#Java\">\uff14\uff0e\u3010\u53c2\u8003\u3011Java\u3067\u3088\u304f\u4f7f\u3046\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9<\/a><ul><li><a href=\"#-API\">\uff14-\uff11\uff0e\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3010\u6a19\u6e96API\u3011<\/a><\/li><li><a href=\"#-XMLAPI\">\uff14-\uff12\uff0eXML\u3092\u8aad\u307f\u8fbc\u3080\u3010\u6a19\u6e96API\u3011<\/a><\/li><li><a href=\"#-JSON\">\uff14-\uff13\uff0eJSON\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/a><\/li><li><a href=\"#-Excel\">\uff14-\uff14\uff0eExcel\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/a><\/li><li><a href=\"#-CSV\">\uff14-\uff15\uff0eCSV\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/a><\/li><\/ul><\/li><li><a href=\"#i-3\">\uff15\uff0e\u307e\u3068\u3081<\/a><\/li><\/ul><\/div>\n<h2><span id=\"JavaFiles\">\uff11\uff0e\u3010Java\u3011<span>Files<\/span>\u3067\u8aad\u307f\u8fbc\u3080<\/span><\/h2>\n<p>Java 11\u304c\u51fa\u3066\u3057\u3070\u3089\u304f\u7d4c\u3063\u305f\u4eca\u3001<strong><\/strong><span class=\"f-marker-p\"><strong>\u4e00\u756a\u304a\u624b\u8efd\u306a\u306e\u306fjava.nio.file.Files\u3092\u4f7f\u3046\u3053\u3068\u3067\u3059<\/strong><\/span>\u3002\u3082\u306e\u3059\u3054\u304f\u7c21\u5358\u3067\u3001\u4eca\u307e\u3067\u52c9\u5f37\u3057\u3066\u304d\u305f\u30ce\u30a6\u30cf\u30a6\u306f\u306a\u3093\u3060\u3063\u305f\u306e\u304b\u3068\u3001\u6115\u7136\u3068\u3059\u308b\u304f\u3089\u3044\u3067\u3059\u3002<\/p>\n<h3><span id=\"-StringJava_11\">\uff11-\uff11\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092<span>String<\/span>\u306b\u3059\u308b\u3010<span>Java 11<\/span>\u4ee5\u964d\u3011<\/span><\/h3>\n<p>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u3059\u3079\u3066\u4e00\u5ea6\u306b\u8aad\u307f\u8fbc\u3093\u3067\u4e00\u3064\u306e<span>String<\/span>\u306b\u3059\u308b\u306b\u306f\u3001<span>Files.readString<\/span>\u3092\u4f7f\u3044\u307e\u3059<span>(Java 11<\/span>\u4ee5\u964d<span>)<\/span>\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 11\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\nString text = Files.readString(file);<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u5f15\u6570\u304c<span>Path<\/span>\u3060\u3051\u306e<span>Files.readString<\/span>\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<span>(<\/span>\u3044\u308f\u3086\u308b\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u3053\u3068\u3067\u3059<span>)<\/span>\u304c<span>UTF-8<\/span>\u3067\u3042\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c<span>UTF-8<\/span>\u4ee5\u5916\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307e\u305b\u308b\u3068\u3001\u6587\u5b57\u5316\u3051\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>Shift-JIS\u306a\u3069\u3001<span>UTF-8<\/span>\u4ee5\u5916\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u305f\u3044\u306a\u3089\u3001\u5f15\u6570\u306b<span>java.nio.charset.Charset<\/span>\u3092\u6307\u5b9a\u3067\u304d\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 11\u4ee5\u964d\r\n\/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408(Charset)\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\nString text = Files.readString(file, Charset.forName(\"MS932\"));<\/pre>\n<p>Files\u306b\u306f\u4ed6\u306b\u3082\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c9\u304c\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u304c\u3001\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u6307\u5b9a\u306e\u4ed5\u65b9\u306f\u5168\u3066\u540c\u3058\u3067\u3059\u3002<\/p>\n<h3><span id=\"-StringListJava_7\">\uff11-\uff12\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092<span>String<\/span>\u306e<span>List<\/span>\u306b\u3059\u308b\u3010<span>Java 7<\/span>\u4ee5\u964d\u3011<\/span><\/h3>\n<p>Files.readAllLines\u3092\u4f7f\u3048\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092<span>String<\/span>\u306e<span>List<\/span>\u306b\u3059\u308b\u3053\u3068\u3082\u8d85\u7c21\u5358\u3067\u3059<span>(Java 7<\/span>\u4ee5\u964d<span>)<\/span>\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 7\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\nList&lt;String&gt; text = Files.readAllLines(file); \/\/ UTF-8\r\nList&lt;String&gt; text2 = Files.readAllLines(file, Charset.forName(\"MS932\")); \/\/ MS932<\/pre>\n<h3><span id=\"-byteJava_7\">\uff11-\uff13\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092<span>byte<\/span>\u914d\u5217\u306b\u3059\u308b\u3010<span>Java 7<\/span>\u4ee5\u964d\u3011<\/span><\/h3>\n<p>\u540c\u3058\u30ce\u30ea\u3067\u3001<span>Files.readAllBytes<\/span>\u3092\u4f7f\u3063\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3068\u3057\u3066<span>byte<\/span>\u914d\u5217\u306b\u8aad\u307f\u8fbc\u3093\u3067\u307f\u307e\u3057\u3087\u3046<span>(Java 7<\/span>\u4ee5\u964d<span>)<\/span>\u3002\u3053\u308c\u3082\u30e1\u30bd\u30c3\u30c9\u4e00\u3064\u3067\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 7\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\nbyte[] bytes = Files.readAllBytes(file);<\/pre>\n<h3><span id=\"-StreamJava_8\">\uff11-\uff14\uff0e\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092<span>Stream<\/span>\u3067\u8aad\u307f\u8fbc\u3080\u3010<span>Java 8<\/span>\u4ee5\u964d\u3011<\/span><\/h3>\n<p>Files.lines\u3092\u4f7f\u3048\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5404\u884c\u3092\u6301\u3064<span>Stream<\/span>\u3092\u4f5c\u308c\u307e\u3059<span>(Java 8<\/span>\u4ee5\u964d<span>)<\/span>\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u5165\u529b\u5143\u3068\u3057\u305f<span>Stream<\/span>\u3092\u7c21\u5358\u306b\u4f5c\u308c\u308b\u306e\u3067\u3001\u8272\u3005\u3068\u624b\u9593\u304c\u7701\u3051\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 8\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\nFiles.lines(file).forEach(System.out::println); \/\/ UTF-8\r\nFiles.lines(file, Charset.forName(\"MS932\")).forEach(System.out::println); \/\/ MS932<\/pre>\n<h3><span id=\"-Files\">\uff11-\uff15\uff0eFiles\u3092\u4f7f\u3046\u6642\u306f\u30e1\u30e2\u30ea\u4e0d\u8db3\u306b\u6c17\u3092\u4ed8\u3051\u3088\u3046<\/span><\/h3>\n<p>Files\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u6642\u306f\u3001\u4f55<span>G<\/span>\u30d0\u30a4\u30c8\u3082\u3042\u308b\u3088\u3046\u306a\u5de8\u5927\u306a\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u4f7f\u308f\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<span>OutOfMemoryError<\/span>\u304c\u7c21\u5358\u306b\u8d77\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>Files\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u4f7f\u3044\u65b9\u304c\u3068\u3066\u3082\u7c21\u5358\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u3082\u3068\u3066\u3082\u77ed\u304f\u66f8\u3051\u307e\u3059\u306e\u3067\u3001\u666e\u6bb5\u4f7f\u3044\u3068\u3057\u3066\u306f\u4fbf\u5229\u306a\u3082\u306e\u3067\u3059\u3002\u3067\u3082\u3001\u9006\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u3092\u96a0\u3057\u3066\u3057\u307e\u3063\u3066\u3082\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3059\u306e\u3067\u3001\u3082\u3057<span>Java<\/span>\u306e\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u306e\u52c9\u5f37\u3092\u3057\u305f\u3044\u306a\u3089\u3001\u6b21\u7ae0\u3067\u8aac\u660e\u3059\u308b<span>Reader\/InputStream<\/span>\u306e\u4f7f\u3044\u65b9\u3092\u5b66\u3093\u3067\u304a\u3044\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u30e1\u30e2\u30ea\u3092\u52b9\u7387\u7684\u306b\u4f7f\u3048\u307e\u3059\u3057\u3001\u30af\u30e9\u30b9\u3054\u3068\u306e\u6a5f\u80fd\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f5c\u308b\u3001<span>Decorator<\/span>\u30d1\u30bf\u30fc\u30f3\u306e\u898b\u672c\u3067\u3082\u3042\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<h2><span id=\"JavaReaderInputStream\">\uff12\uff0e\u3010Java\u3011<span>Reader\/InputStream<\/span>\u3067\u8aad\u307f\u8fbc\u3080<\/span><\/h2>\n<p>Java 7\u3067<span>Files<\/span>\u304c\u8ffd\u52a0\u3055\u308c\u308b\u307e\u3067\u306f\u3001<span>java.io.FileReader<\/span>\u3084<span>FileInputStream<\/span>\u306a\u3069\u3092\u4f7f\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306e\u304c\u3001<span>Java<\/span>\u3067\u306e\u666e\u901a\u3067\u3057\u305f\u3002\u3082\u3061\u308d\u3093\u3001\u3053\u308c\u3089\u306f\u4eca\u3067\u3082\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3084\u308a\u65b9\u306a\u3089\u3001\u73fe\u5728\u306e<span>Java<\/span>\u306e\u74b0\u5883\u3067\u3042\u308c\u3070\u3001\u307e\u305a<span>100%<\/span>\u3069\u3053\u3067\u3082\u4f7f\u3048\u307e\u3059\u3002\u4e92\u63db\u6027\u3092\u91cd\u8996\u3057\u305f\u5927\u5b89\u5b9a\u306a\u65b9\u6cd5\u3068\u8a00\u3048\u307e\u3059\u3057\u3001\u3053\u306e\u3084\u308a\u65b9\u306a\u3089\u308f\u304b\u308b\u3068\u3044\u3046\u4eba\u3082\u975e\u5e38\u306b\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3><span id=\"i\">\uff12-\uff11\uff0e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u884c\u305a\u3064\u8aad\u307f\u8fbc\u3080<\/span><\/h3>\n<p>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f\u3001FileReader\u306e\u4ed6\u306b\u3001BufferedReader\/FileInputStream\/InputStreamReader\u306a\u3069\u3092\u7d44\u307f\u5408\u308f\u305b\u307e\u3059\u3002<\/p>\n<p>FileReader\u3060\u3051\u3067\u3082\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u306f\u3067\u304d\u307e\u3059\u304c\u3001<span>int<\/span>\u3067\u306e\u6587\u5b57\u5358\u4f4d\u3084<span>char<\/span>\u306e\u914d\u5217\u3067\u3057\u304b\u8aad\u307f\u8fbc\u3081\u306a\u3044\u306e\u3067\u3001\u4f7f\u3044\u52dd\u624b\u306f\u3088\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>BufferedReader\u3068\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u3001<span>BufferedReader.readLine<\/span>\u3092\u4f7f\u3063\u3066\u884c\u5358\u4f4d\u3067\u8aad\u307f\u8fbc\u3081\u307e\u3059\u3002\u3057\u304b\u3082\u3001<span>BufferedReader<\/span>\u3067\u306e\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u306b\u3088\u308a\u8aad\u307f\u8fbc\u307f\u306e\u6027\u80fd\u3082\u5411\u4e0a\u3057\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u3084\u308a\u65b9\u304c<span>Java<\/span>\u3067\u306e\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<h4>\uff12-\uff11-\uff11\uff0eFileReader\u3067\u8aad\u307f\u8fbc\u3080<\/h4>\n<p>FileReader\u3068<span>BufferedReader<\/span>\u3092\u4f7f\u3046\u306e\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c<span>Java<\/span>\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u74b0\u5883\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3044\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u3092\u5148\u982d\u884c\u304b\u3089\u9806\u756a\u306b\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u7d42\u308f\u3063\u305f\u3089<span>close<\/span>\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b<span>!!<\/span><\/p>\n<pre class=\"prettyprint lang:default decode:true\">File file = new File(\"\/A\/B\/C.txt\");\r\nFileReader fr = new FileReader(file);\r\nBufferedReader br = new BufferedReader(fr);\r\nString text;\r\nwhile ((text = br.readLine()) != null) {\r\n\tSystem.out.println(text);\r\n}\r\nbr.close();<\/pre>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u77ed\u304f\u3059\u308b\u306e\u3068\u3001<span>close<\/span>\u3092\u5fd8\u308c\u306a\u3044\u305f\u3081\u306b\u3082\u3001<span>Java 7<\/span>\u4ee5\u964d\u3067\u4f7f\u3048\u308b<span>try-with-resources<\/span>\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u306e\u304c\u9244\u677f\u3067\u3059\u3002<span>Java 6<\/span>\u4ee5\u524d\u306a\u3089\u3001<span>try-finally<\/span>\u3068\u7d44\u307f\u5408\u308f\u305b\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 7\u4ee5\u964d\r\nFile file = new File(\"\/A\/B\/C.txt\");\r\ntry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\tString text;\r\n\twhile ((text = br.readLine()) != null) {\r\n\t\tSystem.out.println(text);\r\n\t}\r\n}<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 6\u4ee5\u524d\r\nFile file = new File(\"\/A\/B\/C.txt\");\r\nBufferedReader br = null;\r\ntry {\r\n\tbr = new BufferedReader(new FileReader(file));\r\n\tString text;\r\n\twhile ((text = br.readLine()) != null) {\r\n\t\tSystem.out.println(text);\r\n\t}\r\n} finally {\r\n\tif (br != null) {\r\n\t\tbr.close();\r\n\t}\r\n}<\/pre>\n<h4>\uff12-\uff11-\uff12\uff0eFileInputStream\u3067\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u3080<\/h4>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001<span>java.io.InputStreamReader<\/span>\u3068<span>FileInputStrem<\/span>\u3082\u7d44\u307f\u5408\u308f\u305b\u307e\u3057\u3087\u3046\u3002\u3053\u306e\u3088\u3046\u306b\u3001\u3084\u308a\u65b9\u304c\u5c11\u3057\u9055\u3046\u306e\u304c\u899a\u3048\u3065\u3089\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">File file = new File(\"\/A\/B\/C.txt\");\r\ntry (BufferedReader br = new BufferedReader(\r\n\t\tnew InputStreamReader(new FileInputStream(file), Charset.forName(\"MS932\")))) {\r\n\tString text;\r\n\twhile ((text = br.readLine()) != null) {\r\n\t\tSystem.out.println(text);\r\n\t}\r\n}<\/pre>\n<h4>\uff12-\uff11-\uff13\uff0e\u3010Java 8\u4ee5\u964d\u3011Files\u304b\u3089BufferedReader\u3092\u53d6\u5f97\u3057\u3066\u8aad\u307f\u8fbc\u3080<\/h4>\n<p>\u3061\u306a\u307f\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306eBufferedReader\u306f\u3001Files.newBufferedReader\u3067\u3082\u53d6\u5f97\u3067\u304d\u307e\u3059(Java 8\u4ee5\u964d)\u3002BufferedReader\u3092\u53d6\u5f97\u3059\u308c\u3070\u3001\u540c\u69d8\u306e\u4f7f\u3044\u65b9\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 8\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\ntry (BufferedReader br = Files.newBufferedReader(file)) {\r\n\tString text;\r\n\twhile ((text = br.readLine()) != null) {\r\n\t\tSystem.out.println(text);\r\n\t}\r\n}<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 8\u4ee5\u964d\r\n\/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\ntry (BufferedReader br = Files.newBufferedReader(file, Charset.forName(\"MS932\"))) {\r\n\tString text;\r\n\twhile ((text = br.readLine()) != null) {\r\n\t\tSystem.out.println(text);\r\n\t}\r\n}<\/pre>\n<h3><span id=\"i-2\">\uff12-\uff12\uff0e\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080<\/span><\/h3>\n<p>\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f\u3001java.io.BufferedInputStream\u3068FileInputStream\u3092\u7d44\u307f\u5408\u308f\u305b\u307e\u3059\u3002BufferedInputStream\u306f\u3001BufferedReader\u3068\u540c\u3058\u3088\u3046\u306a\u3001\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u3059\u308b\u5f79\u5272\u3092\u6301\u3064InputStream\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u306e\u3088\u3046\u306b\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u5927\u304d\u3055\u306e<span>byte<\/span>\u914d\u5217\u3092\u4f5c\u3063\u3066\u3001\u914d\u5217\u306e\u4e2d\u306b\u5c11\u3057\u305a\u3064\u8aad\u307f\u8fbc\u3093\u3067\u3044\u304f\u306e\u304c\u666e\u901a\u3067\u3059\u3002<span>read<\/span>\u306e\u623b\u308a\u5024\u306f\u8aad\u307f\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u306e\u30d0\u30a4\u30c8\u6570\u3067\u3059\u306e\u3067\u3001\u305d\u308c\u3092\u4e0a\u9650\u3068\u3057\u3066\u914d\u5217\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">File file = new File(\"\/A\/B\/C.txt\");\r\ntry (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) {\r\n\tbyte[] bytes = new byte[1024];\r\n\tint read = 0;\r\n\twhile ((read = bis.read(bytes, 0, bytes.length)) != -1) {\r\n\t\t\/\/ \u914d\u5217bytes\u306b\u8aad\u307f\u8fbc\u307e\u308c\u305f\u30d0\u30a4\u30ca\u30ea\u30c7\u30fc\u30bf\u3067\u4f55\u304b\u3092\u3059\u308b\r\n\t\t\/\/ \u914d\u5217bytes\u306b\u306f\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9read\u307e\u3067\u30c7\u30fc\u30bf\u304c\u8aad\u307f\u3053\u307e\u308c\u3066\u3044\u308b\r\n\t}\r\n}<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u5168\u4f53\u3092\u4e00\u6c17\u306b\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u8abf\u3079\u305f\u4e0a\u3067\u3001\u305d\u306e\u5927\u304d\u3055\u306e<span>byte<\/span>\u914d\u5217\u3092\u4f5c\u308a\u3001\u4e00\u6c17\u306b<span>read<\/span>\u3057\u307e\u3059\u3002\u3042\u308b\u7a0b\u5ea6\u5c0f\u3055\u3044\u3053\u3068\u304c\u5206\u304b\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306a\u3089\u3001\u3053\u3061\u3089\u306e\u65b9\u304c\u30eb\u30fc\u30d7\u304c\u3044\u3089\u306a\u3044\u306e\u3067\u7c21\u5358\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">File file = new File(\"\/A\/B\/C.txt\");\r\nbyte[] bytes = new byte[(int) file.length()];\r\ntry (FileInputStream fis = new FileInputStream(file)) {\r\n\tfis.read(bytes, 0, bytes.length);\r\n}<\/pre>\n<h2><span id=\"JavaFileChannel\">\uff13\uff0e\u3010Java\u3011<span>FileChannel<\/span>\u3067\u8aad\u307f\u8fbc\u3080<\/span><\/h2>\n<h3><span id=\"-Channel\">\uff13-\uff11\uff0eChannel\u3068\u306f\u901f\u5ea6\u91cd\u8996\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/span><\/h3>\n<p>Java 1.4\u3067\u5c0e\u5165\u3055\u308c\u305f<span>NIO(New I\/O)<\/span>\u3067\u3001<span>Channel<\/span>\u3068\u3044\u3046\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306f<span>Buffer<\/span>\u3068\u3044\u3046\u30af\u30e9\u30b9\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3082\u306e\u3067\u3001\u4f55\u304b\u3078\u306e\u5165\u51fa\u529b\u306e\u901f\u3055\u3092\u91cd\u8996\u3059\u308b\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u300c\u4f55\u304b\u300d\u306b\u306f\u3001\u5f53\u7136\u30d5\u30a1\u30a4\u30eb\u3082\u3042\u308a\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u5165\u529b\u306b<span>java.nio.channels.FileChannel<\/span>\u3092\u4f7f\u3046\u3068\u3001<span>Reader<\/span>\u3088\u308a\u3082\u305a\u3063\u3068\u901f\u304f\u8aad\u307f\u8fbc\u3081\u308b\u306e\u3067\u3059\u3002<\/p>\n<h3><span id=\"-FileChannelReader\">\uff13-\uff12\uff0eFileChannel\u3068Reader\u306f\u4f7f\u3044\u65b9\u304c\u5168\u304f\u9055\u3046<\/span><\/h3>\n<p>\u305f\u3060\u3057\u3001FileChannel\u306fReader\/InputStream\u3068\u306f\u4f7f\u3044\u65b9\u304c\u307e\u3063\u305f\u304f\u9055\u3044\u307e\u3059\u3002Channel\/Buffer\u306e\u6982\u5ff5\u3084\u3001\u4f7f\u3044\u65b9\u306e\u77e5\u8b58\u3092\u5b66\u3076\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u901f\u5ea6\u304c\u6c42\u3081\u3089\u308c\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u306b<span>FileChannel<\/span>\u3092\u4f7f\u3046\u3068\u3001<span>Channel<\/span>\u3084<span>Buffer<\/span>\u306e\u3053\u3068\u3092\u77e5\u3089\u306a\u3044\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u3064\u3044\u3066\u3053\u308c\u306a\u3044\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u306e\u3067\u3001\u3042\u307e\u308a\u304a\u52e7\u3081\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u5206\u304b\u3063\u3066\u3044\u308b\u4eba\u5411\u3051\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f<span>FileChannel<\/span>\u3068<span>ByteBuffer<\/span>\u306b\u3064\u3044\u3066\u3001\u7c21\u5358\u306b\u89e6\u308c\u308b\u3060\u3051\u306b\u7559\u3081\u307e\u3059\u3002\u3082\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u901f\u5ea6\u3092\u91cd\u8996\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u304c\u5fc5\u8981\u306b\u306a\u3063\u305f\u5834\u5408\u306f\u3001\u3053\u306e\u5185\u5bb9\u3092\u8d77\u70b9\u306b\u3057\u3066\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001<span>FileChannel<\/span>\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u306e\u30ed\u30c3\u30af<span>(<\/span>\u6392\u4ed6\u5236\u5fa1<span>)<\/span>\u304c\u51fa\u6765\u308b\u306a\u3069\u3001<span>Reader<\/span>\u3084<span>Files<\/span>\u306b\u306f\u306a\u3044\u3001\u4fbf\u5229\u306a\u6a5f\u80fd\u3082\u3042\u308a\u307e\u3059\u3088\u3002<\/p>\n<h3><span id=\"-FileChannelByteBuffer\">\uff13-\uff13\uff0eFileChannel\u3068ByteBuffer\u3092\u4f7f\u3063\u3066\u307f\u308b<\/span><\/h3>\n<p>FileChannel\u306f\u3001FileChannel.open\u3067\u76f4\u63a5\u53d6\u5f97\u3059\u308b\u304b(Java 7\u4ee5\u964d)\u3001FileInputStream\u3084RandomAccessFile\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u7cfbStream\u304b\u3089\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001<span>FileChannel<\/span>\u304b\u3089\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<span>FileChannel<\/span>\u304b\u3089\u306e\u30c7\u30fc\u30bf\u306e\u53d7\u3051\u53e3\u3068\u3057\u3066\u3001<span>1024<\/span>\u30d0\u30a4\u30c8\u5206\u306e\u9818\u57df\u3092\u6301\u3063\u305f<span>ByteBuffer<\/span>\u3082\u7528\u610f\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001<span>Reader<\/span>\u3067\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u6642\u306b\u7528\u610f\u3057\u305f<span>byte<\/span>\u914d\u5217\u306e\u5f79\u5272\u306b\u8fd1\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>FileChannel.read\u3092<span>ByteBuffer<\/span>\u3092\u5f15\u6570\u306b\u5b9f\u884c\u3059\u308b\u3068\u3001<span>Channel<\/span>\u81ea\u8eab\u304c\u628a\u63e1\u3057\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u4f4d\u7f6e\u304b\u3089\u3001<span>ByteBuffer<\/span>\u3078\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u304c\u884c\u308f\u308c\u307e\u3059\u3002\u3053\u308c\u3092\u30d5\u30a1\u30a4\u30eb\u306e\u3059\u3079\u3066\u3092\u8aad\u307f\u8fbc\u3080\u307e\u3067\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ Java 7\u4ee5\u964d\r\nPath file = Paths.get(\"\/A\/B\/C.txt\");\r\ntry (FileChannel fc = FileChannel.open(file)) { \/\/ FileChannel\u3092\u751f\u6210\r\n\tByteBuffer buf = ByteBuffer.allocate(1024); \/\/ 1024\u30d0\u30a4\u30c8\u5206\u306e\u30d0\u30c3\u30d5\u30a1\u3092\u78ba\u4fdd\r\n\twhile (true) {\r\n\t\tbuf.clear(); \/\/ \u30d0\u30c3\u30d5\u30a1\u306eposition\/limit\u3092\u30ea\u30bb\u30c3\u30c8\r\n\t\tif (fc.read(buf) == -1) { \/\/ \u30d0\u30c3\u30d5\u30a1\u306b\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tbuf.flip(); \/\/ position\u3068limit\u3092\u5165\u308c\u66ff\u3048\r\n\t\t\/\/ \u30d0\u30c3\u30d5\u30a1\u5185\u306e\u5185\u5bb9\u3092\u5168\u3066\u3001\u6a19\u6e96\u51fa\u529b\u3078\u51fa\u529b\u3057\u3066\u307f\u308b\r\n\t\twhile (buf.hasRemaining()) {\r\n\t\t\tSystem.out.println((char) buf.get());\r\n\t\t}\r\n\t}\r\n}<\/pre>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u5358\u7d14\u306b\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u304b\u3089<span>1024<\/span>\u30d0\u30a4\u30c8\u305a\u3064\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u304c\u3001<span>FileChannel<\/span>\u3067\u306f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u304c\u51fa\u6765\u307e\u3059\u306e\u3067\u3001\u7528\u9014\u306b\u3088\u3063\u3066\u306f\u4fbf\u5229\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3><span id=\"-FileChannel\">\uff13-\uff14\uff0eFileChannel\u3092\u4f7f\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc<\/span><\/h3>\n<p>Java 7\u306b\u306a\u308b\u307e\u3067\u3001<span>Java<\/span>\u306b\u306f\u6a19\u6e96\u306e\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc\u7528\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3067\u3059\u304b\u3089\u3001<span>FileInputStream<\/span>\u3068<span>FileOutputStream<\/span>\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u81ea\u4f5c\u3059\u308b\u304b\u3001\u5916\u90e8\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u306e\u304c\u666e\u901a\u3067\u3057\u305f\u3002<\/p>\n<p>\u3067\u3082\u3001\u901f\u5ea6\u91cd\u8996\u306e\u5834\u5408\u306f<span>FileChannel<\/span>\u3092\u4f7f\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3082\u3067\u304d\u307e\u3059\u3002\u3055\u3059\u304c\u306b<span>Files.copy<\/span>\u3088\u308a\u306f\u884c\u6570\u304c\u591a\u3044\u3067\u3059\u304c\u3001<span>InputStream\/OutputStream<\/span>\u3092\u4f7f\u3046\u3088\u308a\u306f\u77ed\u304f\u3067\u304d\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">Path src = Paths.get(\"\/A\/B\/C.txt\");\r\nPath dest = Paths.get(\"\/A\/B\/D.txt\");\r\ntry (FileChannel srcChannel = FileChannel.open(src);\r\n\t\tFileChannel destChannel = FileChannel.open(dest, StandardOpenOption.CREATE,\r\n\t\t\t\tStandardOpenOption.WRITE)) {\r\n\tsrcChannel.transferTo(0, srcChannel.size(), destChannel);\r\n}<\/pre>\n<h2><span id=\"Java\">\uff14\uff0e\u3010\u53c2\u8003\u3011<span>Java<\/span>\u3067\u3088\u304f\u4f7f\u3046\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9<\/span><\/h2>\n<h3><span id=\"-API\">\uff14-\uff11\uff0e\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3010\u6a19\u6e96<span>API<\/span>\u3011<\/span><\/h3>\n<p>Java\u3067\u306f\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb<span>(.properties)<\/span>\u3092\u826f\u304f\u4f7f\u3044\u307e\u3059\u3002\u305d\u308c\u3089\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u3084\u308a\u65b9\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u306f<span>java.util.Properties<\/span>\u3068<span>java.util.ResourceBundle<\/span>\u3092\u4f7f\u3063\u305f\u3084\u308a\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u3053\u3067\u306f<span>PC<\/span>\u4e0a\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fb\u30d5\u30a9\u30eb\u30c0\u306b\u3042\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u3067\u3059\u3002<span>PC<\/span>\u4e0a\u306b\u300c<span>\/A\/B\/C.properties<\/span>\u300d\u3068\u3044\u3046\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u30af\u30e9\u30b9\u30d1\u30b9\u4e0a\u306b\u3042\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001<span>ClassLoader<\/span>\u3068\u30af\u30e9\u30b9\u30d1\u30b9\u4e0a\u306b\u3042\u308b\u30e2\u30ce\u3092\u6307\u5b9a\u3059\u308b\u30d1\u30b9\u306e\u77e5\u8b58\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3061\u3089\u306f\u5225\u9014\u8abf\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\"># C.properties\r\nhello=hello, world.<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">File propFile = new File(\"\/A\/B\/C.properties\");\r\nProperties prop = new Properties();\r\nprop.load(new FileReader(propFile));\r\nSystem.out.println(prop.getProperty(\"hello\")); \/\/ \u2192 hello, world.<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">File propDir = new File(\"\/A\/B\");\r\nClassLoader classLoader = new URLClassLoader(new URL[] { propDir.toURI().toURL() });\r\nResourceBundle bundle = ResourceBundle.getBundle(\"C\", Locale.getDefault(), classLoader);\r\nSystem.out.println(bundle.getString(\"hello\")); \/\/ \u2192 hello, world.<\/pre>\n<h3><span id=\"-XMLAPI\">\uff14-\uff12\uff0eXML\u3092\u8aad\u307f\u8fbc\u3080\u3010\u6a19\u6e96<span>API<\/span>\u3011<\/span><\/h3>\n<p>XML\u3082\u3068\u3066\u3082\u826f\u304f\u4f7f\u3046\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<span>Java<\/span>\u3067\u306f\u6a19\u6e96<span>API<\/span>\u306b<span>XML<\/span>\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306e\u30af\u30e9\u30b9\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u304c\u3001<span>XML<\/span>\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b<span>Java<\/span>\u306e\u5916\u3067\u6c7a\u3081\u3089\u308c\u3066\u3044\u308b\u6a19\u6e96<span>API<\/span>\u306b\u5bfe\u5fdc\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u305e\u308c\u3084\u308a\u65b9\u304c\u7570\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u3067\u306f\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h4>\uff14-\uff12-\uff11\uff0eDOM(Document Object Model)<\/h4>\n<p>DOM(Document Object Model)\u306f\u3001JavaScript\u3067\u3082\u7528\u3044\u3089\u308c\u308b\u3001XML\u64cd\u4f5cAPI\u306e\u6a19\u6e96\u3067\u3059\u3002<\/p>\n<p>Java\u3067\u306f<span>DOM<\/span>\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9<span>Document<\/span>\u3092\u3001<span>DocumentBuilder<\/span>\u3068\u3044\u3046\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u4f5c\u308a\u307e\u3059\u3002<span>Document<\/span>\u304c\u6301\u3064\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u6a19\u6e96\u306e<span>DOM<\/span>\u3068\u540c\u3058\u3082\u306e\u3067\u3059\u3002<\/p>\n<p><strong><span class=\"f-marker-p\">C.xml<\/span><\/strong><\/p>\n<pre class=\"prettyprint lang:default decode:true\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\r\n&lt;hello&gt;hello, world.&lt;\/hello&gt;<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">File xml = new File(\"\/A\/B\/C.xml\");\r\nDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\nDocumentBuilder documentBuilder = factory.newDocumentBuilder();\r\nDocument document = documentBuilder.parse(xml);\r\nElement root = document.getDocumentElement();\r\nSystem.out.println(root.getTextContent()); \/\/ \u2192 hello, world.<\/pre>\n<h4>\uff14-\uff12-\uff12\uff0eSAX<\/h4>\n<p>Java\u3067XML\u3092\u8aad\u307f\u8fbc\u3080\u969b\u306e\u3082\u3046\u4e00\u3064\u306e\u3084\u308a\u65b9\u306fSAX(Simple API for XML)\u3067\u3059\u3002\u3053\u3061\u3089\u306f<span>DOM<\/span>\u3068\u306f\u5c11\u3005\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4ed5\u65b9\u304c\u9055\u3044\u3001\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u578b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>SAX\u304c<span>XML<\/span>\u3092\u982d\u304b\u3089\u9806\u756a\u306b\u8aad\u307f\u8fbc\u307f\u3001<span>XML<\/span>\u306e\u8981\u7d20\u3084\u5c5e\u6027\u304c\u51fa\u3066\u304f\u308b\u305f\u3073\u306b\u3001\u6307\u5b9a\u3057\u305f<span>XML<\/span>\u89e3\u6790\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3070\u308c\u307e\u3059\u3002\u3067\u3059\u306e\u3067\u3001\u8907\u96d1\u306a\u69cb\u9020\u306e<span>XML<\/span>\u3067\u3082\u3001\u7279\u5b9a\u306e\u8981\u7d20\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3059\u308c\u3070\u3044\u3044\u5834\u5408\u306b\u306f\u4fbf\u5229\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">File xml = new File(\"\/A\/B\/C.xml\");\r\nSAXParserFactory factory = SAXParserFactory.newInstance();\r\nSAXParser parser = factory.newSAXParser();\r\nparser.parse(xml, new SampleSAXParser());<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">\/\/ SampleXMLParser.java\r\nimport org.xml.sax.helpers.DefaultHandler;\r\n\r\nclass SampleSAXParser extends DefaultHandler {\r\n\t\/\/ XML\u4e2d\u3067\u6587\u5b57\u304c\u51fa\u73fe\u3057\u305f\u6642\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\r\n\tpublic void characters(char[] ch, int offset, int length) {\r\n\t\tSystem.out.println(new String(ch, offset, length)); \/\/ \u2192 hello, world.\r\n\t}\r\n}<\/pre>\n<h3><span id=\"-JSON\">\uff14-\uff13\uff0eJSON\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/span><\/h3>\n<p>\u6700\u8fd1\u306f<span>JSON(JavaScript Object Notation)<\/span>\u3092\u6271\u3046\u6a5f\u4f1a\u304c\u5927\u5909\u5897\u3048\u3066\u304d\u307e\u3057\u305f\u3088\u306d\u3002<\/p>\n<p>Java\u3067\u306f<span>JSON<\/span>\u3092\u6271\u3046\u3084\u308a\u65b9\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u305d\u306e\u4e00\u3064\u3001<span>Jackson<\/span>\u3092\u4f7f\u3063\u3066\u306e<span>JSON<\/span>\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u3092\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>Jackson\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3082\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n<span style=\"text-decoration:none !important; background-color:#a61e58; color:white; padding:4px 13px; font-size:12px; font-weight:bold; position:relative; top:10px; z-index:1; left:11px;\">\u95a2\u9023\u8a18\u4e8b<\/span>\n<div class=\"blog-card\"><a target=\"_blank\" href=\"https:\/\/www.bold.ne.jp\/engineer-club\/java-json\" style=\"text-decoration:none;\">\n    <div class=\"blog-card-thumbnail\"><img src='https:\/\/www.bold.ne.jp\/engineer-club\/wp-content\/uploads\/2018\/10\/shutterstock_568617811-600x366.jpg' alt='Java\u306eJSON\u3068\u306f\uff1f\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u898b\u3084\u3059\u304f\u8868\u73fe\u3059\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u300cJSON\u300d\u3092\u89e3\u8aac' width=160 height=98 \/><\/div>\n    <div class=\"blog-card-content\">\n        <div class=\"blog-card-title\">Java\u306eJSON\u3068\u306f\uff1f\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u898b\u3084\u3059\u304f\u8868\u73fe\u3059\u308b\u30c7\u30fc\u30bf\u5f62\u5f0f\u300cJSON\u300d\u3092\u89e3\u8aac <\/div>\n        <span style=\"font-size: 12px; font-weight: normal; position:relative; color:#666;\"><i class=\"fa fa-clock-o\"><\/i>&nbsp;2025\/09\/17<\/span>\n    <\/div>\n<div class=\"clear\"><\/div>\n<\/a><\/div>\n<p><strong><span class=\"f-marker-p\">C.json<\/span><\/strong><\/p>\n<pre class=\"prettyprint lang:default decode:true\">{\r\n\t\"hello\": \"hello, world.\"\r\n}<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">File json = new File(\"\/A\/B\/C.json\");\r\nObjectMapper mapper = new ObjectMapper();\r\nJsonNode root = mapper.readTree(json);\r\nSystem.out.println(root.get(\"hello\").textValue()); \/\/ \u2192 hello, world.<\/pre>\n<h3><span id=\"-Excel\">\uff14-\uff14\uff0eExcel\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/span><\/h3>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f<span>Excel<\/span>\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb<span>(<\/span>\u30d5\u30a1\u30a4\u30eb\u62e1\u5f35\u5b50<span>xls<\/span>\u3001<span>xlsx<\/span>\u306a\u3069<span>)<\/span>\u3092\u8aad\u307f\u8fbc\u307e\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u6642\u3082\u3042\u308a\u307e\u3059\u3002<span>Java<\/span>\u3067<span>Excel<\/span>\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u306a\u3089\u3001<span>Apache POI(<a href=\"https:\/\/poi.apache.org\/\">https:\/\/poi.apache.org\/<\/a>)<\/span>\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u3067\u3059\u3088\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001<span>1<\/span>\u3064\u76ee\u306e\u30b7\u30fc\u30c8\u306e<span>A1<\/span>\u30bb\u30eb\u306b\u3042\u308b\u5024\u3092\u3001\u30c6\u30ad\u30b9\u30c8\u3068\u3057\u3066\u8aad\u307f\u53d6\u3063\u3066\u3044\u307e\u3059\u3002<span>Workbook<\/span>\u3001<span>Sheet<\/span>\u3001<span>Row<\/span>\u3001<span>Cell<\/span>\u306a\u3069\u306e\u30af\u30e9\u30b9\u306b\u3088\u308a\u3001\u304b\u306a\u308a\u76f4\u611f\u7684\u306b\u6271\u3048\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"prettyprint lang:default decode:true\">File xls = new File(\"\/A\/B\/C.xlsx\");\r\nWorkbook workbook = WorkbookFactory.create(xls);\r\nSheet sheet = workbook.getSheetAt(0);\r\nRow row = sheet.getRow(0);\r\nCell cell = row.getCell(0);\r\nSystem.out.println(cell.getStringCellValue()); \/\/ \u2192 hello, world.<\/pre>\n<h3><span id=\"-CSV\">\uff14-\uff15\uff0eCSV\u3092\u8aad\u307f\u8fbc\u3080\u3010\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3011<\/span><\/h3>\n<p>\u30c7\u30fc\u30bf\u3092\u3084\u308a\u53d6\u308a\u3059\u308b\u306e\u306b\u304a\u624b\u8efd\u306a\u306e\u306f\u3001\u4eca\u3082\u6614\u3082<span>CSV(Comma-Separated Values)<\/span>\u3067\u3059\u3002<\/p>\n<p>Java\u3067<span>CSV<\/span>\u3092\u6271\u3046\u6642\u306f\u3001\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3093\u3067\u5404\u884c\u3092<span>&#8220;,&#8221;<\/span>\u3067<span>split<\/span>\u3057\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f<span>CSV<\/span>\u306f\u7d50\u69cb\u8907\u96d1\u306a\u4ed5\u69d8\u304c\u3042\u3063\u3066\u3001\u304d\u3061\u3093\u3068\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308b\u306b\u306f\u5927\u5909\u306a\u3082\u306e\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3082\u5916\u90e8\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3068\u5927\u5909\u304a\u624b\u8efd\u306b\u8aad\u307f\u8fbc\u3081\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001<span>Apache Commons CSV(<a href=\"http:\/\/commons.apache.org\/proper\/commons-csv\/\">http:\/\/commons.apache.org\/proper\/commons-csv\/<\/a>)<\/span>\u3092\u7c21\u5358\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p><strong><span class=\"f-marker-p\">C.csv<\/span><\/strong><\/p>\n<pre class=\"prettyprint lang:default decode:true\">\"hello, world.\",\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c<\/pre>\n<pre class=\"prettyprint lang:default decode:true\">File csv = new File(\"\/A\/B\/C.csv\");\r\nFileReader fr = new FileReader(csv);\r\nCSVParser parser = CSVFormat.DEFAULT.parse(fr);\r\nList&lt;CSVRecord&gt; records = parser.getRecords();\r\nSystem.out.println(records.get(0).get(0)); \/\/ \u2192 hello, world.<\/pre>\n<h2><span id=\"i-3\">\uff15\uff0e\u307e\u3068\u3081<\/span><\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<span>Java<\/span>\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u3092\u304a\u4f1d\u3048\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u3067\u306f\u3001\u4e00\u756a\u7c21\u5358\u306a\u306e\u306f<span>Files<\/span>\u3092\u4f7f\u3046\u3053\u3068\u3067\u3059\u3002\u3069\u306e\u74b0\u5883\u3067\u3082\u52d5\u304b\u3057\u305f\u3044\u306a\u3089\u3001<span>FileReader\/FileInputStream<\/span>\u3068<span>BufferedReader\/BufferedInputStream<\/span>\u3092\u7d44\u307f\u5408\u308f\u305b\u307e\u3059\u3002\u8aad\u307f\u8fbc\u307f\u306e\u901f\u5ea6\u3092\u512a\u5148\u3059\u308b\u306a\u3089\u3001<span>FileChannel<\/span>\u3068<span>ByteBuffer<\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u30fb\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u4ee5\u5916\u306b\u3082\u3001<span>Java<\/span>\u3067\u65e5\u5e38\u7684\u306b\u8aad\u307f\u8fbc\u3080\u30d5\u30a1\u30a4\u30eb\u306e\u5f62\u5f0f\u306f\u591a\u3044\u3067\u3059\u3002\u3088\u304f\u4f7f\u308f\u308c\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3001<span>XML<\/span>\u3001<span>JSON<\/span>\u3001<span>Excel<\/span>\u3001<span>CSV<\/span>\u306a\u3069\u3082\u3001<span>Java<\/span>\u3067\u306f\u3057\u3063\u304b\u308a\u8aad\u307f\u8fbc\u3081\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u304a\u4f1d\u3048\u3057\u305f\u306e\u306f\u3001\u5927\u4f53\u306f<span>Java<\/span>\u306e\u6a19\u6e96<span>API<\/span>\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u3084\u308a\u65b9\u3067\u3059\u3002<span>Java<\/span>\u306b\u306f\u6a19\u6e96<span>API<\/span>\u4ee5\u5916\u306b\u3082<span>Apache Commons IO<\/span>\u306a\u3069\u306e\u8c4a\u5bcc\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u3089\u3092\u8abf\u3079\u3066\u3001\u6d3b\u7528\u3057\u3066\u307f\u308b\u3068\u4fbf\u5229\u3067\u3059\u3088\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u304c\u8a95\u751f\u3057\u305f\u306e\u306f1995\u5e74\u30012019\u5e74\u73fe\u5728\u3067\u306f24\u5e74\u307b\u3069\u306e\u6b74\u53f2\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u9577\u3044\u6b74\u53f2\u306e\u4e2d\u3067\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u3082\u5c11\u3057\u305a\u3064\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002 Java\u3067\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u306b\u306f\u3001Java 11\u306e\u6642\u70b9\u3067\u306f\u5927\u304d\u304f\u5206 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1338"}],"collection":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/comments?post=1338"}],"version-history":[{"count":10,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1338\/revisions"}],"predecessor-version":[{"id":5765,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/posts\/1338\/revisions\/5765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media\/804"}],"wp:attachment":[{"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/media?parent=1338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bold.ne.jp\/engineer-club\/wp-json\/wp\/v2\/categories?post=1338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}