4

I am using binary readers and writers to read / write data to a file. For example for this:

MyWriter.Write(Ord(TMyEnum(2)));

I would expect it to write down SmallInt to be read with

MyReader.ReadSmallInt

But in IDE I see it writes down byte. How do I force the writer to write the type that I want?

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467

1 Answers1

4

Cast it to Smallint

Smallint(SomeEnum)
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490