mina 使用IoBuffer获取byte[]

    /**
     * 获取IoBuffer len长度数据
     * @param buf
     * @param len 长度
     * @return byte[]
     */
    public static byte[] IoBuffertoBytes(IoBuffer buf,int len){
        byte[] b = new byte[len];
        buf.get(b);
        return b;
    }

//byte[]转String   

new String(byte[])

猜你喜欢

转载自blog.csdn.net/weixin_42591674/article/details/82735821