writeUTF輸出字串失敗的原因分析

2021-08-22 18:45:09 字數 435 閱讀 1970

字串比較長了之後,資料就發不過去了,經檢查jdk的源**,原來有長度限制。

為了保險起見,我們還是不要超過65535/3 我看取20000好了。

public

final

void writeutf(string str) throws ioexception 

static

int writeutf(string str, dataoutput out) throws ioexception  else

if (c > 0x07ff)  else 

}if (utflen > 65535)

throw

new utfdataformatexception("encoded string too long: " + utflen + " bytes");

// 其他的語句

}

writeUTF輸出字串失敗的原因分析

字串比較長了之後,資料就發不過去了,經檢查jdk的源 原來有長度限制。為了保險起見,我們還是不要超過65535 3 我看取20000好了。public final void writeutf string str throws ioexception static int writeutf stri...

輸出字串

5.連線字串 半形句號 是字串連線符,可以把兩個字串連線成乙個字串。例如7 5 echo str.url 技巧 我們可以使用字串連線符累加字串。例如7 6 第一句我們給 str賦值,str表示字串 php中文社群位址是 第二句表示在 str的值上累加字串 www.phpnet.cn 所以,str最後...

輸出字串Count and Say

最近研究輸出字串,稍微總結一下,以後繼續補充 標題如下 the count and say sequence is the sequence of integers beginning as follows 1,11,21,1211,111221,1is read off as one 1 or11...