(WebPDecoder): use IBinaryStream instead of BinaryReader.

This commit is contained in:
morkt
2016-12-03 19:17:30 +04:00
parent e2ec6423d1
commit 0b12c7bcef
3 changed files with 25 additions and 53 deletions

View File

@@ -599,7 +599,7 @@ namespace GameRes.Formats.Google
br_.Init (data, data_i, (uint)data_size);
}
public void Init (BinaryReader input, int length, VP8Io io)
public void Init (IBinaryStream input, int length, VP8Io io)
{
io_ = io;
br_.Init (input, (uint)length);
@@ -1614,7 +1614,7 @@ namespace GameRes.Formats.Google
{
ulong val_; // pre-fetched bits
byte[] buf_; // input byte buffer
uint end_pos_; // buffer length
uint end_pos_; // buffer length
uint pos_; // byte position in buf_
int bit_pos_; // current bit-reading position in val_
bool eos_; // true if a bit was read past the end of buffer
@@ -1653,7 +1653,7 @@ namespace GameRes.Formats.Google
buf_ = input;
}
public void Init (BinaryReader input, uint length)
public void Init (IBinaryStream input, uint length)
{
var buf = input.ReadBytes ((int)length);
if (buf.Length != length)