File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

change java byte to unsigned

 
sweety mehra
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since java byte is signed, so is there any method to change java byte to unsigned
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there aren't any unsigned types in Java, so what do you mean?

When you assign an integral type to a larger integral type, Java will sign-extend it. If you then zero-out the higher-order bits, then you have an integer with the value that would have been represented by the smaller type, if it were unsigned.

Example:


Is that what you meant?
[ February 12, 2007: Message edited by: Peter Chase ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic