Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get this same output format in java  RSS feed

 
Muthu Kumaran Murugesan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pump_on = struct.pack("IIHHI", 0, 0, 21, 96, 512)
print pump_on
This is function in python used for packing values in specified format
the output for the above line
'\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00`\x00\x00\x02\x00\x00'

so how to get this output in java
is there any function like pack or
any way to get this out put


If any suggestions kindly advice me
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it's you asking the same question there. Please BeForthrightWhenCrossPostingToOtherSites.
 
Rob Spoor
Sheriff
Posts: 20968
84
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this essentially the same problem as this one?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!