It's not a secret anymore!
The moose likes Java in General and the fly likes readShort vs readUnsignedShort() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "readShort vs readUnsignedShort()" Watch "readShort vs readUnsignedShort()" New topic
Author

readShort vs readUnsignedShort()

william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
how is readShort() different from readUnsignedShort() when both of them are meant to read data written using writeShort()?


Help me!Help you!!!
Shivaji Marathe
Ranch Hand

Joined: Jan 11, 2002
Posts: 203
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 ]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: readShort vs readUnsignedShort()
 
It's not a secret anymore!