[Oberon] ReadInt vs ReadNum

Chris Burrows chris at cfbsoftware.com
Sun Jun 19 08:53:34 CEST 2016


> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Srinivas Nayak
> Sent: Sunday, 19 June 2016 3:10 PM
> To: ETH Oberon and related systems
> Subject: [Oberon] ReadInt vs ReadNum
> 
> What is the difference between Files.ReadInt and Files.ReadNum?
> Where to use which one?
> 

Use Files.ReadInt if Files.WriteInt was used to write to the file you are
reading from and Files.ReadNum if Files.WriteNum was used. 

Assuming 32 bit integers, WriteNum uses from 1 to 5 bytes to store the
integer depending on its size whereas WriteInt always uses 4 bytes.

Hence, you would use WriteNum to write integers to a file if your data
contained a majority of small integers and you wanted smaller file sizes and
faster read / write times. 


Regards,
Chris 

Chris Burrows
CFB Software
http://www.astrobe.com







More information about the Oberon mailing list