简体   繁体   English

Java-DataOutputStream的writeLong方法并写入十六进制

[英]Java - writeLong method of DataOutputStream and writing hex

Currently, I have: 目前,我有:

outByte.writeInt(0x49492a00); 
outByte.writeInt(0x08000000);

But i want to be able to write all of that on the same line. 但是我希望能够在同一行上编写所有这些内容。 But: 但:

outByte.writeLong(0x49492a0008000000)

is underlined red in Eclipse, and therefore incorrect. 在Eclipse中用红色下划线标记,因此不正确。 Is it possible to write those two lines all in one with writeLong()? 是否可以使用writeLong()一起写这两行?

要在源代码中使用long文字,您需要将lL附加到常量如下:

outByte.writeLong(0x49492a0008000000L)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM