閱讀770 返回首頁    go 阿裏雲 go 技術社區[雲棲]


怎樣把一個long型的數據轉換為數組

 
//把一個long型的數據轉換為數組
		Long num = 9809L;
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		DataOutputStream dos = new DataOutputStream(bos);
		dos.writeLong(num);
		byte[] buf = bos.toByteArray();
		System.out.println(buf.length);

最後更新:2017-04-02 06:52:18

  上一篇:go JAVA數據結構與算法-第二章-數組
  下一篇:go MyEclipse配置JDK類庫的簡易流程