{"id":326886,"date":"2023-09-09T18:15:10","date_gmt":"2023-09-09T18:15:10","guid":{"rendered":"https:\/\/www.baeldung.com\/?p=165322"},"modified":"2023-09-09T18:15:10","modified_gmt":"2023-09-09T18:15:10","slug":"closing-java-io-streams","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2023\/09\/09\/closing-java-io-streams\/","title":{"rendered":"Closing Java IO Streams"},"content":{"rendered":"<p class=\"syndicated-attribution\"><meta name= \\\"keywords \\\" content= \\\"\u96fb\u5b50\u8a08\u7b97\u6a5f, \u6559\u80b2, IT \u96fb\u8166\u73ed,\u96fb\u8166\u88dc\u7fd2\uff0c \u96fb\u8166\u73ed\uff0c \u5bb6\u6559\uff0c \u79c1\u4eba\u8001\u5e2b\uff0c \u8cc7\u8a0a\u6280\u8853\uff0c \u7a0b\u5e8f\u8a2d\u8a08\uff0c \u96fb\u5b50\u8a08\u7b97\u6a5f\uff0c \u904a\u6232\uff0c \u860b\u679c\uff0c \u96fb\u5f71\uff0c \u8a08\u7b97\u6a5f\uff0c\u7de8\u78bc\uff0c Java\uff0c C\/C++\uff0c JavaScript\uff0c PHP\uff0c HTML\uff0c CSS\uff0c MySQL\uff0c mobile\uff0c Android\uff0c \u52d5\u6f2b\uff0c Python\uff0c teacher\uff0c \u88dc\u7fd2\uff0c \u96fb\u8166\u88dc\u7fd2 \u8cc7\u8a0a, \u7535\u5b50\u8ba1\u7b97\u673a, IT ,Game, apple, movie, Computer,student,Java,\u6559\u80b2, ,\u5b66\u751f, \u5b66\u4e60, learn, \u6559\u5b66,  Android, apple,anime, animation, \u4fe1\u606f\u6280\u672f, \u7a0b\u5e8f\u8bbe\u8ba1, \u79fb\u52a8\u7535\u8bdd, \u8cc7\u8a0a\u79d1\u6280,Game, Jeu, Juego,Call Of Duty ,\u4f7f\u547d\u53ec\u559a , \u6e38\u620f, \u7535\u5b50\u6e38\u620f,, \u591a\u4eba\u7535\u5b50\u6e38\u620f, \u7f51\u7edc\u6e38\u620f\uff0conline\uff0conline game, \u624b\u673a\u6e38\u620f, mobile \\\"><\/p>\n<p><img src=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-1024x536.png\" class=\"webfeedsFeaturedVisual wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" style=\"float: left; margin-right: 5px;\" srcset=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-1024x536.png 1024w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-300x157.png 300w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-768x402.png 768w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-100x52.png 100w, https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured.png 1200w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/p>\n<h2 id=\"bd-overview\" data-id=\"overview\">1. Overview<\/h2>\n<div class=\"bd-anchor\" id=\"overview\"><\/div>\n<p>It&#8217;s important to ensure the proper closing of IO streams within the realm of Java IO operations. This is significant for resource management and code robustness.<\/p>\n<p>In this tutorial, we&#8217;ll <strong>explore in detail why it&#8217;s necessary to close IO streams<\/strong>.<\/p>\n<h2 id=\"bd-what-happens-when-io-streams-arent-closed\" data-id=\"what-happens-when-io-streams-arent-closed\">2. What Happens When IO Streams Aren&#8217;t Closed?<\/h2>\n<div class=\"bd-anchor\" id=\"what-happens-when-io-streams-arent-closed\"><\/div>\n<p>It&#8217;s always a good practice to explicitly close IO streams right after finishing all operations on them. Neglecting to close them may cause various issues.<\/p>\n<p>In this section, we&#8217;ll take a look at these issues.<\/p>\n<h3 id=\"bd-1-resource-leakage\" data-id=\"1-resource-leakage\">2.1. Resource Leakage<\/h3>\n<div class=\"bd-anchor\" id=\"1-resource-leakage\"><\/div>\n<p>Whenever we open an IO steam, it always takes up a bit of system resources. <strong>The resources aren&#8217;t released until the IO stream <em>close()<\/em> method is called. <\/strong><\/p>\n<p>Certain IO stream implementations can close themselves automatically within their <em>finalize()<\/em> method. The <em>finalize()<\/em> method is invoked whenever the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/jvm-garbage-collectors\">garbage collector<\/a> (GC) is triggered.<\/p>\n<p>However, there&#8217;s no guarantee that the GC will be invoked, nor on when it will be called. It&#8217;s possible that the resources run out before the GC is called. Therefore, <strong>we shouldn&#8217;t solely depend on GC to reclaim system resources.<\/strong><\/p>\n<h3 id=\"bd-2-data-corruption\" data-id=\"2-data-corruption\">2.2. Data Corruption<\/h3>\n<div class=\"bd-anchor\" id=\"2-data-corruption\"><\/div>\n<p>We often wrap a <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-outputstream#outputstream-buffering\"><em>BufferedOutputStream<\/em><\/a> around an <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-outputstream\"><em>OutputStream<\/em><\/a> to provide buffered capability to reduce the overhead of each write operation. It&#8217;s a common practice and aims to improve the performance in writing data.<\/p>\n<p>The internal buffer within the <em>BufferedOutputStream<\/em> is a staging area for data that is for temporary storage. Whenever the buffer reaches a certain size or the <em>flush()<\/em> method is called, the data will be written to the destination.<\/p>\n<p>After we finish writing data to the <em>BufferedOutputStream<\/em>, it&#8217;s possible that the last chunk of data isn&#8217;t yet written to the target, leading to data corruption. <strong>Calling the <em>close()<\/em> method invokes <em>flush()<\/em> to write the remaining data in the buffer.\u00a0<\/strong><\/p>\n<h3 id=\"bd-3-file-locking\" data-id=\"3-file-locking\">2.3. File Locking<\/h3>\n<div class=\"bd-anchor\" id=\"3-file-locking\"><\/div>\n<p>When we write data to a file using <em>FileOutputStream<\/em>, some operating systems such as Windows hold the file in our application. <strong>This prevents other applications from writing or even accessing the file until the <em>FileOutputStream<\/em> is closed.<\/strong><\/p>\n<h2 id=\"bd-closing-io-streams\" data-id=\"closing-io-streams\">3. Closing IO Streams<\/h2>\n<div class=\"bd-anchor\" id=\"closing-io-streams\"><\/div>\n<p>Now let&#8217;s take a look at a few approaches for closing Java IO streams. These approaches help avoid the issues we discussed above and ensure proper resource management.<\/p>\n<h3 id=\"bd-1-try-catch-finally\" data-id=\"1-try-catch-finally\">3.1. <em>try-catch-finally<\/em><\/h3>\n<div class=\"bd-anchor\" id=\"1-try-catch-finally\"><\/div>\n<p>This is the traditional way of closing IO streams. <strong>We close IO streams in the <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-exceptions#3-finally\"><em>finally<\/em><\/a> block. This ensures the <em>close()<\/em> method is invoked no matter whether the operations are successful or not<\/strong>:<\/p>\n<pre><code class=\"language-java\">InputStream inputStream = null;\r\nOutputStream outputStream = null;\r\ntry {\r\n    inputStream = new BufferedInputStream(wrappedInputStream);\r\n    outputStream = new BufferedOutputStream(wrappedOutputStream);\r\n    \/\/ Stream operations...\r\n}\r\nfinally {\r\n    try {\r\n        if (inputStream != null)\r\n            inputStream.close();\r\n    }\r\n    catch (IOException ioe1) {\r\n        log.error(&quot;Cannot close InputStream&quot;);\r\n    }\r\n    try {\r\n        if (outputStream != null)\r\n            outputStream.close();\r\n    }\r\n    catch (IOException ioe2) {\r\n        log.error(&quot;Cannot close OutputStream&quot;);\r\n    }\r\n}<\/code><\/pre>\n<p>As we&#8217;ve demonstrated, the <em>close()<\/em> method could raise an <em>IOException<\/em> as well. Therefore, we must put another <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/java-exceptions#2-try-catch\"><em>try-catch<\/em><\/a> block in the <em>finally<\/em> block when closing the IO streams. <strong>This process becomes cumbersome when there are numerous IO streams we have to deal with<\/strong>.<\/p>\n<h3 id=\"bd-2-apache-commons-io\" data-id=\"2-apache-commons-io\">3.2. Apache Commons IO<\/h3>\n<div class=\"bd-anchor\" id=\"2-apache-commons-io\"><\/div>\n<p><a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/www.baeldung.com\/apache-commons-io\">Apache Commons IO<\/a> is a versatile Java library that provides utility classes and methods for IO operations.<\/p>\n<p>To use it, let&#8217;s include the following <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/mvnrepository.com\/artifact\/commons-io\/commons-io\">dependency<\/a> in our <em>pom.xml<\/em>:<\/p>\n<pre><code class=\"language-xml\">&lt;dependency&gt;\r\n    &lt;groupId&gt;commons-io&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;commons-io&lt;\/artifactId&gt;\r\n    &lt;version&gt;2.13.0&lt;\/version&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<p>The Apache Commons library simplifies complex tasks such as closing IO streams in a <em>finally<\/em> block:<\/p>\n<pre><code class=\"language-java\">InputStream inputStream = null;\r\nOutputStream outputStream = null;\r\ntry {\r\n    inputStream = new BufferedInputStream(wrappedInputStream);\r\n    outputStream = new BufferedOutputStream(wrappedOutputStream);\r\n    \/\/ Stream operations...\r\n}\r\nfinally {\r\n    IOUtils.closeQuietly(inputStream);\r\n    IOUtils.closeQuietly(outputStream);\r\n}<\/code><\/pre>\n<p><strong><em>IOUtils.closeQuietly()<\/em> efficiently closes IO streams without the need for null checking and taking care of exceptions that occur during the closing process.<\/strong><\/p>\n<p>Besides <em>IOUtils.closeQuietly()<\/em>, <strong>the library also provides the <em>AutoCloseInputStream<\/em> class to automate the closure of the wrapped <em>InputStream<\/em><\/strong>:<\/p>\n<pre><code class=\"language-java\">InputStream inputStream = AutoCloseInputStream.builder().setInputStream(wrappedInputStream).get();\r\nbyte[] buffer = new byte[256];\r\nwhile (inputStream.read(buffer) != -1) {\r\n    \/\/ Other operations...\r\n}<\/code><\/pre>\n<p>The example above reads data from the <em>InputStream<\/em>. <strong><em>AutoCloseInputStream<\/em> closes the <em>InputStream<\/em> automatically as soon as it reaches the end of the input,<\/strong> which is determined by getting <em>-1<\/em> from the <em>read()<\/em> method in the <em>InputStream<\/em>. In this case, we don&#8217;t even need to call the <em>close()<\/em> method explicitly.<\/p>\n<h3 id=\"bd-3-try-with-resources\" data-id=\"3-try-with-resources\">3.3. <em>try-with-resources<\/em><\/h3>\n<div class=\"bd-anchor\" id=\"3-try-with-resources\"><\/div>\n<p>The <em>try-with-resources<\/em> block was introduced in Java 7. It is considered the preferred way of closing IO streams.<\/p>\n<p><strong>This approach allows us to define resources within the <em>try<\/em> statement.<\/strong> A resource is an object that must be closed when we finish using it.<\/p>\n<p>For instance, classes such as <em>InputStream<\/em> and <em>OutputStream <\/em>that implement the <em>AutoClosable<\/em> interface are used as resources. They&#8217;ll be automatically closed after the <em>try-catch<\/em> block. This <strong>eliminates the need to call the <em>close()<\/em> method in the <em>finally<\/em> block explicitly<\/strong>:<\/p>\n<pre><code class=\"language-java\">try (BufferedInputStream inputStream = new BufferedInputStream(wrappedInputStream);\r\n     BufferedOutputStream outputStream = new BufferedOutputStream(wrappedOutputStream)) {\r\n    \/\/ Stream operations...\r\n}\r\n<\/code><\/pre>\n<p>Further advancements emerged in Java 9, refining the <em>try-with-resources<\/em> syntax. <strong>We can declare the resource variables ahead of the <em>try-with-resources<\/em> block, and specify their variable names directly in the <em>try<\/em> statement<\/strong>:<\/p>\n<pre><code class=\"language-java\">InputStream inputStream = new BufferedInputStream(wrappedInputStream);\r\nOutputStream outputStream = new BufferedOutputStream(wrappedOutputStream);\r\ntry (inputStream; outputStream) {\r\n    \/\/ Stream operations...\r\n}<\/code><\/pre>\n<h2 id=\"bd-conclusion\" data-id=\"conclusion\">4. Conclusion<\/h2>\n<div class=\"bd-anchor\" id=\"conclusion\"><\/div>\n<p>In this article, we examined various strategies for closing IO streams, from traditional methods invoking the <em>close()<\/em> method in the <em>finally<\/em> blocks to more streamlined approaches offered by libraries like Apache Commons IO and the elegance of <em>try-with-resources<\/em>.<\/p>\n<p>With a spectrum of various techniques, we can choose the approach that aligns best with our codebase and ensures smooth and error-free IO operations.<\/p>\n<p>As usual, the source code presented in the article is available <a href=\"https:\/\/feeds.feedblitz.com\/~\/t\/0\/0\/baeldung\/~https:\/\/github.com\/eugenp\/tutorials\/tree\/master\/core-java-modules\/core-java-io\">over on GitHub<\/a>.<\/p>\n<p><Img align=\"left\" border=\"0\" height=\"1\" width=\"1\" alt=\"\" style=\"border:0;float:left;margin:0;padding:0;width:1px!important;height:1px!important;\" hspace=\"0\" src=\"https:\/\/feeds.feedblitz.com\/~\/i\/792871736\/0\/baeldung\"><\/p>\n<div style=\"clear:both;padding-top:0.2em;\"><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/792871736\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2021%2F09%2FJava-8-Featured-1024x536.png\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\" style=\"border:0;margin:0;padding:0;\"><\/a>&#160;<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/java-io-streams-closing#respond\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>&#160;<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/java-io-streams-closing\/feed\"><img decoding=\"async\" height=\"20\" style=\"border:0;margin:0;padding:0;\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>&#160;<\/div>\n\n<p class=\"syndicated-attribution\"><figure class= \\\"wp-block-image alignnone \\\"><img src= \\\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/05\/logo2-2.png\\\" alt=\\\"IT\u96fb\u8166\u88dc\u7fd2 java\u88dc\u7fd2 \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b, PHP\u88dc\u7fd2,CSS\u88dc\u7fd2,XML,Java\u88dc\u7fd2,MySQL\u88dc\u7fd2,graphic design\u88dc\u7fd2,\u4e2d\u5c0f\u5b78ICT\u88dc\u7fd2,\u4e00\u5c0d\u4e00\u79c1\u4eba\u88dc\u7fd2\u548cFreelance\u81ea\u7531\u5de5\u4f5c\u914d\u5c0d\u3002\\\"\/><figcaption>\u7acb\u523b\u8a3b\u518a\u53ca\u5831\u540d\u96fb\u8166\u88dc\u7fd2\u8ab2\u7a0b\u5427!<\/figcaption><\/figure>\r\n<\/br>Find A Teacher Form:\r\n<\/br>https:\/\/docs.google.com\/forms\/d\/1vREBnX5n262umf4wU5U2pyTwvk9O-JrAgblA-wH9GFQ\/viewform?edit_requested=true#responses\r\n<\/br><\/br>Email:\r\n<\/br>public1989two@gmail.com<br><br><br><br><br><br><br>\r\n<a href=www.itsec.hk style=color:#FFFFFF;>www.itsec.hk<\/a><br>\r\n<a href=\\\"www.itsec.vip\\\" style=color:#FFFFFF;>www.itsec.vip<\/a><br>\r\n<a href=\\\"www.itseceu.uk\\\" style=color:#FFFFFF;>www.itseceu.uk<\/a><br><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p><img decoding=\"async\" src=\"https:\/\/www.baeldung.com\/wp-content\/uploads\/2021\/09\/Java-8-Featured-1024x536.png\" class=\"webfeedsFeaturedVisual wp-post-image\" alt=\"\" loading=\"lazy\"><\/p>\n<p>Learn why it&#8217;s necessary to close IO streams and how to do it.<\/p>\n<div><a title=\"Like on Facebook\" href=\"https:\/\/feeds.feedblitz.com\/_\/28\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/fblike20.png\"><\/a>\u00a0<a title=\"Pin it!\" href=\"https:\/\/feeds.feedblitz.com\/_\/29\/792871736\/baeldung,https%3A%2F%2Fwww.baeldung.com%2Fwp-content%2Fuploads%2F2021%2F09%2FJava-8-Featured-1024x536.png\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/pinterest20.png\"><\/a>\u00a0<a title=\"Tweet This\" href=\"https:\/\/feeds.feedblitz.com\/_\/24\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/twitter20.png\"><\/a>\u00a0<a title=\"Subscribe by email\" href=\"https:\/\/feeds.feedblitz.com\/_\/19\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/email20.png\"><\/a>\u00a0<a title=\"Subscribe by RSS\" href=\"https:\/\/feeds.feedblitz.com\/_\/20\/792871736\/baeldung\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/rss20.png\"><\/a>\u00a0<a rel=\"NOFOLLOW\" title=\"View Comments\" href=\"https:\/\/www.baeldung.com\/java-io-streams-closing#respond\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/comments20.png\"><\/a>\u00a0<a title=\"Follow Comments via RSS\" href=\"https:\/\/www.baeldung.com\/java-io-streams-closing\/feed\"><img decoding=\"async\" height=\"20\" src=\"https:\/\/assets.feedblitz.com\/i\/commentsrss20.png\"><\/a>\u00a0<\/div>\n<\/div>","protected":false},"author":1978,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Closing Java IO Streams - ITTeacherITFreelance.hk","description":"Learn why it's necessary to close IO streams and how to do it. \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0"},"footnotes":""},"categories":[6,1307],"tags":[10565],"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/326886"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1978"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=326886"}],"version-history":[{"count":1,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/326886\/revisions"}],"predecessor-version":[{"id":326887,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/326886\/revisions\/326887"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=326886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=326886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=326886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}