小编Gan*_*nan的帖子

如何从Android模拟器中删除示例应用程序?

不知何故,我已从工作区删除了示例应用程序的代码,但应用程序仍显示在Android模拟器中.我该如何删除它们?

android emulation android-emulator

37
推荐指数
3
解决办法
4万
查看次数

通过网络写入4字节的无符号整数

我在java中编写无符号4字节int时遇到问题.

在java中写一个long值在64位MacOS和32位Linux(Ubuntu)上有不同的结果或者写入一个4字节的unsigned int有一个问题.

以下调用在我的本地OSX上完美运行

writeUInt32(999999,outputstream)
Run Code Online (Sandbox Code Playgroud)

读回来给我999999

但是,当应用程序部署到网络时,写入一个长值会产生一些其他随机数(我假设字节序已被切换?)并且读取它会给我一些其他大数字.

----------完整的方法堆栈如下---------------

public void writeUInt32(long uint32,DataOutputStream stream) throws IOException {
        writeUInt16((int) (uint32 & 0xffff0000) >> 16,stream);
        writeUInt16((int) uint32 & 0x0000ffff,stream);
    }

public void writeUInt16(int uint16,DataOutputStream stream) throws IOException {
        writeUInt8(uint16 >> 8, stream);
        writeUInt8(uint16, stream);
    }

public void writeUInt8(int uint8,DataOutputStream stream) throws IOException {
        stream.write(uint8 & 0xFF);
    }
Run Code Online (Sandbox Code Playgroud)

编辑:添加到写入文件的混乱,然后通过网络传输它给我发送正确的值!因此,当输出流指向本地文件时,它会写入正确的值,但是当输出流指向ByteArrayOutputStream时,则写入的长值是错误的.

java networking unsigned casting long-integer

4
推荐指数
1
解决办法
4455
查看次数

Thymeleaf 3 Beta的春季靴子

Thymeleaf 3 beta的弹簧启动似乎不太好.

java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.security.FallbackWebSecurityAutoConfiguration due to internal class not found. 

This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) 
Run Code Online (Sandbox Code Playgroud)

....

 Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/resourceresolver/IResourceResolver
Run Code Online (Sandbox Code Playgroud)

有关如何使其工作的任何想法?

基本上,我有预先构建的HTML模板,它们并不真正符合XHTML标准,我想在Thymeleaf中使用它.Thymeleaf 2不支持HTML,甚至LEGACYHTML5模式因角度标记而引发错误

所以,我坚持使用只使用Thyme2而不支持Thyme3的Spring Boot,但我的应用程序只适用于Thyme3

spring spring-mvc angularjs thymeleaf spring-boot

3
推荐指数
1
解决办法
2480
查看次数