Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

readShort vs readUnsignedShort()

 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how is readShort() different from readUnsignedShort() when both of them are meant to read data written using writeShort()?
 
Shivaji Marathe
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
readShort can return both the positive and negative values of short.
Readunsingedshort will only return the positive values or rather the absolute values.
Try writing a small program where you write some positive values and some negative values and then try to use readShort and readUnsignedShort to read the positive and negative values.
See what you get.
HTH
[ February 12, 2002: Message edited by: Shivaji Marathe ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic