Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1)
master
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (1)
master
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
master
Java8API
/
src
/
main
/
java
/
LetCode.java
Java8API
/
src
/
main
/
java
/
LetCode.java
LetCode.java 3.59 KB
Copy Edit Raw Blame History
dingqb2 authored 2023年06月19日 14:42 +08:00 . java project transform into gradle project
public class LetCode {
public static void main(String[] args) {
int asd = (int) (10 - -10_01.99);
System.out.println(asd);
//
String getScreenSerialNumber = "2190612310400005";
String strUrl = "http://checkin.sanyevi.cn:6688/" + getScreenSerialNumber
+ "/updateFile.tar.gz";
System.out.println(strUrl);
//http://checkin.sanyevi.cn:6688/SY48500000344/updateFile.tar.gz
// sb.append(String.format("%02d", bean.getAirConditioningAuto()));
getAirConditionByte3(1,2,3);
System.out.println(Integer.parseInt(Long.MAX_VALUE+""));
}
/**
* byte2
*/
public static int getAirConditionByte3(int ... a) {
for (int i = 0; i < a.length; i++) {
System.out.println("getAirConditionByte3:"+a[i]);
}
StringBuilder sb = new StringBuilder();
int testV=9;
String bitStr = Integer.toBinaryString(testV);
sb.append(addZeroForNum(bitStr, 8));
System.out.println(sb.toString());
int result = Integer.parseInt(sb.toString(), 2);
System.out.println(result);
return result;
}
public static String addZeroForNum(String str, int strLength) {
int strLen = str.length();
if (strLen < strLength) {
while (strLen < strLength) {
StringBuffer sb = new StringBuffer();
sb.append("0").append(str);// 左补0
// sb.append(str).append("0");//右补0
str = sb.toString();
strLen = str.length();
}
}
return str;
}
void test1() {
// -98
short s0 = -98;
short s1 = 117;
short s2 = -98;
short s3 = 117;
long a = LetCode.getIntFromByte(s0, s1, s2, s3);
double b = LetCode.getFloatFromByte(158, 117, 158, 117);
System.out.println(a);
System.out.println(b);
System.out.println(-0 & 0xff);
System.out.println(Byte.MAX_VALUE);
System.out.println(Byte.MIN_VALUE);
String s = "a";
boolean ignore = s.equalsIgnoreCase("A");
System.out.println(ignore);
//
}
public static long getIntFromByte(short byte0, short byte1, short byte2, short byte3) {
byte0 = (short) (byte0 & 0xff);
byte1 = (short) (byte1 & 0xff);
byte2 = (short) (byte2 & 0xff);
byte3 = (short) (byte3 & 0xff);
//03 20 00 00
long ret;
ret = byte3;
ret &= 0xff;
ret |= ((long) byte2 << 8);
ret &= 0xffff;
ret |= ((long) byte1 << 16);
ret &= 0xffffff;
ret |= ((long) byte0 << 24);
// int d0 = byte0 << 24;
// int d1 = byte1 << 16;
// int d2 = byte2 & 0xff << 8;
// int d3 = byte3 & 0xff << 0;
// ret = d0 | d1 | d2 | d3;
return ret;
}
public static double getFloatFromByte(int byte0, int byte1, int byte2, int byte3) {
long ret;
ret = byte3;
ret &= 0xff;
ret |= ((long) byte2 << 8);
ret &= 0xffff;
ret |= ((long) byte1 << 16);
ret &= 0xffffff;
ret |= ((long) byte0 << 24);
double v = Double.longBitsToDouble((long) ret);
return v;
}
/**
* Byte转Bit
*/
public static String byteToBit(byte b) {
return "" +
((b >> 7) & 0x1) +
((b >> 6) & 0x1) +
((b >> 5) & 0x1) +
((b >> 4) & 0x1) +
((b >> 3) & 0x1) +
((b >> 2) & 0x1) +
((b >> 1) & 0x1) +
((b >> 0) & 0x1);
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

Releases

No release

Contributors

All

Language(Optional)

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/dinqb/Java8API.git
git@gitee.com:dinqb/Java8API.git
dinqb
Java8API
Java8API
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /