<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          cactoos面向?qū)ο蟮?Java 庫(kù)的集合

          聯(lián)合創(chuàng)作 · 2023-09-28 11:55

          cactoos 是一個(gè)面向?qū)ο蟮?Java 原語(yǔ)的集合,是 Google Guava 和 Apache Commons 的替代品。

          動(dòng)機(jī):JDK, Guava 和 Apache Commons 是程序化的而不是面向?qū)ο蟮摹K麄冎饕峭ㄟ^(guò)靜態(tài)方法來(lái)工作的。Cactoos 則是通過(guò)面向?qū)ο蟆?/p>

          如何使用。庫(kù)沒(méi)有依賴(lài)性,在這里獲得最新版本:

          < dependency > 
            < groupId > org.cactoos </ groupId > 
            < artifactId > cactoos </ artifactId > 
          </ dependency >

          Java版本要求:1.8+。

          StackOverflow標(biāo)簽是cactoos。

          輸入輸出

          以UTF-8讀取文本文件:

          String text =  new  TextOf(
             new  File(“/ code/a.txt ”)
          )。asString();

          將文本寫(xiě)入文件:

          new  LengthOf(
             new  TeeInput(
               “ Hello,world!”,
               new  File(“/ code/a.txt ”)
            )
          )。的intValue();

          從classpath讀取二進(jìn)制文件:

          byte [] data =  new  BytesOf(
             new  ResourceOf(“ foo / img.jpg ”)
          )。asBytes();
          瀏覽 16
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          cactoos面向?qū)ο蟮?Java 庫(kù)的集合
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  99re视频在线观看 | 亚洲A片一区二区三区电影网 | 性导航AV导航 | 免费观看一级一片 | 国产社区 |