?????????楸�??
??????????????????“???????????????写??????”??java??????????写???????效?????????????????????????????????????????????????????????????????????????????????buffer??????buffer??
??????????????
???????????????????????????写??效?????????????????????写?????效???????
??????????????
??????????????????????????????????????????????蔚????????????????????????????????????????????????cpu?????????????????懈??????写?????效??????
?????????榛�??
????OS: windows 7 64bit
????cpu: 4core?? ?????2.4GHZ
????mem??6G
????jdk version??Java HotSpot(TM) 64-Bit ??1.8.0_101
?????濉�??榘�??
???????????8???????椋�??????????????小???10M??50M??100M??200M??500M??800M??1G??2G??
???????????????????????????????????
?????????????
??????1??java???????写????效???????????????

??????1??java???????写????效????????????????????????

??????2??java???????写????效??????????????????????????

?????2???????小?2048m???????写???????????cpu????????

?????3???????小?2048m???????写???????????jvm?????????

?????4???????小?2048m???????写??????????????????????????

????????泻?????‘FileChannel’????渭????????????????
?????????????
????1?????????????写?????????小???????????FileChannel<BufferedOutputStream<FileOutputStream<BufferedWriter<FileWriter;???1???1?????????????霉?????小???写??????锟�??????????2?????????
????2????????????小写???????校???????????buffer???????????/?????????????buffer??????效??????
????3??????写?????jvm cpu??????????????????????2???3?????????
????4????????????小??( fileSize >=1.5G )??FileChannel??????煤?????????????1??????????????????????????????????写???????小???????4????????????????FileChannel???MappedByteBuffer写?????buffer??direct buffer???????????????写????????????????????????
????5??小???写???????锟�?1M???????FileChannel??些???小?????效???????????????效????
???????????????????????屑??????t??椋�
????1??小???????M???????写???????贸????io?????校????????BufferedInportStream????斜?????nio??FileChannel??
????2?????????fileSize > 1G???????????????????????寤�???????????写????????FileChannel???小???????????????????写??效????锟�??????????梅??写???????TODO????????????????
????3???????????锟�????效????????????????????FileChannel写???????
???????demo
?????慰?git???https://github.com/daoqidelv/io-demo