This commit is contained in:
Looly 2020-07-17 12:09:33 +08:00
parent ac81d9e750
commit 41bbd86a14
2 changed files with 15 additions and 18 deletions

View File

@ -11,15 +11,13 @@ import java.util.regex.Pattern;
* <p> * <p>
* 此类来自于Spring-framework * 此类来自于Spring-framework
* *
* <p> * <pre>
* <table border="1"> * byte 1B 1
* <tr><th>Term</th><th>Data Size</th><th>Size in Bytes</th></tr> * kilobyte 1KB 1,024
* <tr><td>byte</td><td>1B</td><td>1</td></tr> * megabyte 1MB 1,048,576
* <tr><td>kilobyte</td><td>1KB</td><td>1,024</td></tr> * gigabyte 1GB 1,073,741,824
* <tr><td>megabyte</td><td>1MB</td><td>1,048,576</td></tr> * terabyte 1TB 1,099,511,627,776
* <tr><td>gigabyte</td><td>1GB</td><td>1,073,741,824</td></tr> * </pre>
* <tr><td>terabyte</td><td>1TB</td><td>1,099,511,627,776</td></tr>
* </table>
* *
* @author Sam Brannen,Stephane Nicoll * @author Sam Brannen,Stephane Nicoll
* @since 5.3.10 * @since 5.3.10
@ -165,6 +163,7 @@ public final class DataSize implements Comparable<DataSize> {
* </pre> * </pre>
* *
* @param text the text to parse * @param text the text to parse
* @param defaultUnit 默认的数据单位
* @return the parsed {@link DataSize} * @return the parsed {@link DataSize}
*/ */
public static DataSize parse(CharSequence text, DataUnit defaultUnit) { public static DataSize parse(CharSequence text, DataUnit defaultUnit) {

View File

@ -6,15 +6,13 @@ import cn.hutool.core.util.StrUtil;
* 数据单位封装<p> * 数据单位封装<p>
* 此类来自于Spring-framework * 此类来自于Spring-framework
* *
* <p> * <pre>
* <table border="1"> * BYTES 1B 2^0 1
* <tr><th>名称</th><th>数据大小</th><th>Power&nbsp;of&nbsp;2</th><th>bytes表示</th></tr> * KILOBYTES 1KB 2^10 1,024
* <tr><td>{@link #BYTES}</td><td>1B</td><td>2^0</td><td>1</td></tr> * MEGABYTES 1MB 2^20 1,048,576
* <tr><td>{@link #KILOBYTES}</td><td>1KB</td><td>2^10</td><td>1,024</td></tr> * GIGABYTES 1GB 2^30 1,073,741,824
* <tr><td>{@link #MEGABYTES}</td><td>1MB</td><td>2^20</td><td>1,048,576</td></tr> * TERABYTES 1TB 2^40 1,099,511,627,776
* <tr><td>{@link #GIGABYTES}</td><td>1GB</td><td>2^30</td><td>1,073,741,824</td></tr> * </pre>
* <tr><td>{@link #TERABYTES}</td><td>1TB</td><td>2^40</td><td>1,099,511,627,776</td></tr>
* </table>
* *
* @author Sam BrannenStephane Nicoll * @author Sam BrannenStephane Nicoll
* @since 5.3.10 * @since 5.3.10