public List<byte[]> Split(long sizeOffset, long sizeLength, BinaryContext context) { var result = new List<byte[]>(); while (!context.EndOfContextReached()) { var sizeValue = context.PeekBytes(sizeOffset, sizeLength); var size = ConvertSize(sizeValue); if (context.CanReadBytes(size)) { result.Add(context.ReadBytes(size)); } else throw new EndOfStreamException("Cannot read next block of size " + size); } return result; }
public List<byte[]> Split(long sizeValue, BinaryContext context) { var result = new List<byte[]>(); while (!context.EndOfContextReached()) { if (context.CanReadBytes(sizeValue)) { result.Add(context.ReadBytes(sizeValue)); } else throw new EndOfStreamException("Cannot read next block of size " + sizeValue); } return result; }
protected override bool EndReading(Configuration configuration, BinaryContext context, List<object> objects) { return (_currentTypeName >= _typeNames.Length || _repeatCounter>=_repeatSequence) && !context.EndOfContextReached(); }
protected override bool EndReading(Configuration configuration, BinaryContext context, List<object> objects) { return _numberOfObjects < 0 ? context.EndOfContextReached() : objects.Count >= _numberOfObjects || context.EndOfContextReached(); }