Ar*********@gmail.com wrote:
how to convert this statement to vb.net???
byte[] buffer = new Byte[checked((uint)Math.Min(4096,
(int)fileStream.Length))];
Dim buffer As New Byte(Math.Min(4096, CInt(fileStream.Length))) {}
I am slightly mystified as to why the cast to uint is there in the
original. Note that I have left in the perhaps-redundant cast to Int32
of fileStream.Length, so that the original's behaviour (throwing an
exception if fileStream.Length can't fit in an Int32) is preserved.
Note also that VB.NET's overflow checking can't be controlled as
grainily as C#'s checked/unchecked allows; this is controlled at
application level; the default is to check everything.
--
Larry Lard
Replies to group please