mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-06-28 15:30:17 +08:00
Merge pull request #573 from GiovanniNova/master
Fixes #567, ReadShort now casts to and returns an ushort
This commit is contained in:
commit
a486114c8d
@ -129,7 +129,7 @@
|
|||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static short ReadShort(Stream stream, byte[] buffer)
|
private static ushort ReadShort(Stream stream, byte[] buffer)
|
||||||
{
|
{
|
||||||
var read = stream.Read(buffer, 0, 2);
|
var read = stream.Read(buffer, 0, 2);
|
||||||
|
|
||||||
@ -138,7 +138,7 @@
|
|||||||
throw new InvalidOperationException("Failed to read a short where expected in the JPEG stream.");
|
throw new InvalidOperationException("Failed to read a short where expected in the JPEG stream.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (short)((buffer[0] << 8) + buffer[1]);
|
return (ushort)((buffer[0] << 8) + buffer[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user