国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

上海網(wǎng)站建設(shè)心得win10一鍵優(yōu)化工具

上海網(wǎng)站建設(shè)心得,win10一鍵優(yōu)化工具,自己做的網(wǎng)站出現(xiàn)左右滑動(dòng)條,廣州做網(wǎng)站哪間公司好Java——進(jìn)制轉(zhuǎn)換的一些內(nèi)容1.16進(jìn)制字符串String轉(zhuǎn)字節(jié)數(shù)組byte[]2.16進(jìn)制字符串String轉(zhuǎn)10進(jìn)制數(shù)字int3.字節(jié)數(shù)組byte[]轉(zhuǎn)字符串String4.16進(jìn)制字符串String-->byte[]-->String(使用ByteBuffer轉(zhuǎn)換)5.字節(jié)數(shù)組byte[]轉(zhuǎn)字符數(shù)組char[]6.字節(jié)byte轉(zhuǎn)…

Java——進(jìn)制轉(zhuǎn)換的一些內(nèi)容

    • 1.16進(jìn)制字符串String轉(zhuǎn)字節(jié)數(shù)組byte[]
    • 2.16進(jìn)制字符串String轉(zhuǎn)10進(jìn)制數(shù)字int
    • 3.字節(jié)數(shù)組byte[]轉(zhuǎn)字符串String
    • 4.16進(jìn)制字符串String-->byte[]-->String(使用ByteBuffer轉(zhuǎn)換)
    • 5.字節(jié)數(shù)組byte[]轉(zhuǎn)字符數(shù)組char[]
    • 6.字節(jié)byte轉(zhuǎn)16進(jìn)制字符串String
    • 7.字節(jié)數(shù)組byte[]轉(zhuǎn)16進(jìn)制數(shù)字int
    • 8.字節(jié)數(shù)組byte[]轉(zhuǎn)16進(jìn)制字符串String

1.16進(jìn)制字符串String轉(zhuǎn)字節(jié)數(shù)組byte[]

String hex = "46534E3131323130393031303030313234";
// 把16進(jìn)制字符串轉(zhuǎn)換為字節(jié)數(shù)組 [70, 83, 78, 49, 49, 50, 49, 48, 57, 48, 49, 48, 48, 48, 49, 50, 52]
public byte[] hexToBytes(String hex){byte[] bytes = Hex.decode(hex);return bytes;
}

2.16進(jìn)制字符串String轉(zhuǎn)10進(jìn)制數(shù)字int

String hex = "FFFF";
String hex2 = "0xFFFF";
public int hexToInt(String hex){int n = Integer.parseInt(hex, 16);//int n = Integer.parseInt(hex2.substring(2), 16);return n;
}

3.字節(jié)數(shù)組byte[]轉(zhuǎn)字符串String

String hex = "46534E3131323130393031303030313234";
byte[] bytes5 = Hex.decode(hex);
String str = new String(bytes5);
public String bytesToString(byte[] bytes){String str = new String(bytes5);return str;
}

4.16進(jìn)制字符串String–>byte[]–>String(使用ByteBuffer轉(zhuǎn)換)

String hex = "46534E3131323130393031303030313234";
public String hexStringToString(String hex) throws CharacterCodingException {byte[] bytes = HexUtils.fromHexString(hex);// 把byte數(shù)組讀取到ByteBuffer中ByteBuffer source = ByteBuffer.wrap(bytes);StringBuilder sb = new StringBuilder();//遍歷字節(jié)數(shù)組的長度,把每個(gè)字節(jié)轉(zhuǎn)成Stringfor (int i = 0; i < bytes.length; i++) {byte[] bytes1 = new byte[1];source.get(bytes1);ByteBuffer buffer1 = ByteBuffer.allocate(1).put(bytes1);buffer1.flip();CharsetDecoder charsetDecoder = StandardCharsets.UTF_8.newDecoder();String s = charsetDecoder.decode(buffer1).toString();sb.append(s);}return sb.toString();
}

5.字節(jié)數(shù)組byte[]轉(zhuǎn)字符數(shù)組char[]

byte[] bytes = new byte[]{35,35};
public char[] bytesToChars(byte[] bytes) {Charset charset = Charset.forName("ISO-8859-1");ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length);byteBuffer.put(bytes);byteBuffer.flip();CharBuffer charBuffer = charset.decode(byteBuffer);char[] array = charBuffer.array();return array;
}

6.字節(jié)byte轉(zhuǎn)16進(jìn)制字符串String

byte b = Byte.parseByte("1");
public String byteToHexString(byte b) {String str = String.format("0x%02X", b);//需要0x...后面幾位數(shù)就在最后一個(gè)x前面寫幾,需要字母大寫就把最后一個(gè)X大寫//int c = b & 0xff;//String str = Integer.toHexString(c);//不需要0x,只顯示數(shù)字return str;
}

7.字節(jié)數(shù)組byte[]轉(zhuǎn)16進(jìn)制數(shù)字int

byte[] bytes = new byte[]{35,35};
//方法1:10進(jìn)制byte轉(zhuǎn)16進(jìn)制字符串,16進(jìn)制字符串轉(zhuǎn)16進(jìn)制數(shù)字int
public int bytesToInt(byte[] bytes) {StringBuilder stringBuilder = new StringBuilder("");for (int i = 0; i < bytes.length; i++) {int b = bytes[i] & 0xff;String str = Integer.toHexString(b);if (str.length() < 2) {stringBuilder.append(0);}stringBuilder.append(str);}return Integer.parseInt(stringBuilder.toString(),16);
}
//方法2:位運(yùn)算直接轉(zhuǎn)(數(shù)組長度必須小于等于4)
public int bytesToInt(byte[] bytes) {ByteBuffer buffer = ByteBuffer.wrap(bytes);int value = 0;for (int i = 0; i < bytes.length; i++) {value = (value << 8) | (buffer.get() & 0xFF);}return value;
}

8.字節(jié)數(shù)組byte[]轉(zhuǎn)16進(jìn)制字符串String

byte[] bytes = new byte[]{35,35};
public String toHexString(byte[] bytes) {if (null == bytes) {return null;}StringBuilder sb = new StringBuilder(bytes.length << 1);for (byte aByte : bytes) {sb.append(hex[(aByte & 0xf0) >> 4]).append(hex[(aByte & 0x0f)]);}return sb.toString();
}
http://aloenet.com.cn/news/39345.html

相關(guān)文章:

  • 免費(fèi)做網(wǎng)站的軟件小廣告設(shè)計(jì)
  • 上市公司做網(wǎng)站源碼網(wǎng)站
  • 做網(wǎng)站用什么語言最好seo優(yōu)化設(shè)計(jì)
  • 陜西 汽車 網(wǎng)站建設(shè)網(wǎng)頁制作源代碼
  • 商城開發(fā)價(jià)格服務(wù)企業(yè)網(wǎng)站優(yōu)化服務(wù)公司
  • 移動(dòng)網(wǎng)站制作價(jià)格安裝百度到手機(jī)桌面
  • 網(wǎng)站是先解析后備案嗎免費(fèi)投放廣告平臺
  • 大片播放網(wǎng)站seo百度發(fā)包工具
  • 鄭州制作網(wǎng)站新站整站快速排名
  • 獨(dú)立網(wǎng)站怎么做推廣google chrome download
  • 網(wǎng)站開發(fā)的前端框架有哪些口碑營銷的案例及分析
  • 視頻網(wǎng)站怎么做算法上海seo外包公司
  • 做搜狗網(wǎng)站優(yōu)化南京seo推廣
  • 定州網(wǎng)站建設(shè)公司最新網(wǎng)絡(luò)營銷方式有哪些
  • wordpress簡介怎么改東莞seo收費(fèi)
  • 手把手教做網(wǎng)站做國外網(wǎng)站
  • 順德網(wǎng)站制作seo課程培訓(xùn)要多少錢
  • 做網(wǎng)站一個(gè)月能掙多少錢網(wǎng)絡(luò)營銷師證書含金量
  • 深圳網(wǎng)站優(yōu)化團(tuán)隊(duì)長春網(wǎng)站優(yōu)化服務(wù)
  • html可視化編輯軟件東莞網(wǎng)站優(yōu)化公司哪家好
  • 做網(wǎng)站用哪個(gè)軟件寫比較好免費(fèi)優(yōu)化網(wǎng)站
  • 雄縣網(wǎng)站建設(shè)免費(fèi)海報(bào)模板網(wǎng)站
  • 網(wǎng)站備案后可以更換域名嗎網(wǎng)絡(luò)營銷是學(xué)什么
  • 濟(jì)南網(wǎng)站優(yōu)化公司拼多多seo是什么意思
  • 360網(wǎng)站建設(shè)公司哪家好查詢關(guān)鍵詞網(wǎng)站
  • 哈爾濱網(wǎng)站建設(shè)資海海外市場推廣做什么的
  • 中學(xué)網(wǎng)站管理系統(tǒng)下載不受限制的搜索引擎
  • 邯鄲做網(wǎng)站優(yōu)化百度網(wǎng)盤手機(jī)app下載安裝
  • 寶雞營銷型網(wǎng)站開發(fā)信息流優(yōu)化師工作內(nèi)容
  • 深喉嚨企業(yè)網(wǎng)站系統(tǒng)網(wǎng)絡(luò)營銷渠道策略有哪些