private void BackpatchSize()
        {
            int size = buffer.Position - context.StartPosition;

            if (size > settings.MaxDocumentSize)
            {
                throw new FileFormatException("Size is larger than MaxDocumentSize");
            }
            buffer.Backpatch(context.StartPosition, size);
        }
Exemple #2
0
        private void BackpatchSize()
        {
            int size = buffer.Position - context.StartPosition;

            if (size > settings.MaxDocumentSize)
            {
                var message = string.Format("Size {0} is larger than MaxDocumentSize {1}.", size, settings.MaxDocumentSize);
                throw new FileFormatException(message);
            }
            buffer.Backpatch(context.StartPosition, size);
        }
Exemple #3
0
        // private methods
        private void BackpatchSize()
        {
            int size = _buffer.Position - _context.StartPosition;

            if (size > _maxDocumentSizeStack.Peek())
            {
                var message = string.Format("Size {0} is larger than MaxDocumentSize {1}.", size, _maxDocumentSizeStack.Peek());
                throw new Exception(message);
            }
            _buffer.Backpatch(_context.StartPosition, size);
        }
 // protected methods
 protected void BackpatchMessageLength(BsonBuffer buffer)
 {
     MessageLength = buffer.Position - _messageStartPosition;
     buffer.Backpatch(_messageStartPosition, MessageLength);
 }