public final class FastdfsUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
first(List<T> list)
获取列表头元素
|
static String |
getFileExt(String filename)
获取文件扩展名
|
static String |
getFileExt(String filename,
String defaultExt)
获取文件扩展名
|
static <T> boolean |
isEmpty(Collection<T> coll)
判断集合是否为空
|
static boolean |
isEmpty(String content)
判断字符串为空
|
static String |
readString(io.netty.buffer.ByteBuf in)
读取字符串(修剪掉补零的字节)
|
static String |
readString(io.netty.buffer.ByteBuf in,
int length)
读取固定长度的字符串(修剪掉补零的字节)
|
static void |
writeFixLength(io.netty.buffer.ByteBuf buf,
String content,
int length)
给 ByteBuf 写入定长字符串
若字符串长度大于定长,则截取定长字节;若小于定长,则补零
|
public static boolean isEmpty(String content)
content - public static <T> boolean isEmpty(Collection<T> coll)
coll - public static <T> T first(List<T> list)
list - public static void writeFixLength(io.netty.buffer.ByteBuf buf,
String content,
int length)
若字符串长度大于定长,则截取定长字节;若小于定长,则补零
buf - content - length - public static String readString(io.netty.buffer.ByteBuf in, int length)
in - length - public static String readString(io.netty.buffer.ByteBuf in)
in - Copyright © 2017. All rights reserved.