Index: lib/src/protobuf/coded_buffer_reader.dart |
diff --git a/lib/src/protobuf/coded_buffer_reader.dart b/lib/src/protobuf/coded_buffer_reader.dart |
index fa0b99f70266f12738f6dc0224b9a3a12f8ad7fd..a22b8f1ed7e0df8bdd158c4a664bac8c6c0aa191 100644 |
--- a/lib/src/protobuf/coded_buffer_reader.dart |
+++ b/lib/src/protobuf/coded_buffer_reader.dart |
@@ -127,7 +127,8 @@ class CodedBufferReader { |
List<int> readBytes() { |
int length = readInt32(); |
_checkLimit(length); |
- return new Uint8List.view(_buffer.buffer, _bufferPos - length, length); |
+ return new Uint8List.view(_buffer.buffer, |
+ _buffer.offsetInBytes + _bufferPos - length, length); |
} |
String readString() => _UTF8.decode(readBytes()); |
double readFloat() => |
@@ -210,7 +211,7 @@ class CodedBufferReader { |
ByteData _readByteData(int sizeInBytes) { |
_checkLimit(sizeInBytes); |
- return new ByteData.view( |
- _buffer.buffer, _bufferPos - sizeInBytes, sizeInBytes); |
+ return new ByteData.view(_buffer.buffer, |
+ _buffer.offsetInBytes + _bufferPos - sizeInBytes, sizeInBytes); |
} |
} |