Code Red > .NET

ResultBuffer's capacity?

<< < (2/3) > >>

dgorsman:
Put another way, logical organization should prevent it from reaching any kind of size where this becomes a problem.

WILL HATCH:
Keith, I'm really surprised this is working properly for you... I can't remember exactly what circumstances (audit?) will expose the underlying error in this usage are however... TypedValue has a limited size, and longer strings must be properly parsed into chunks on their way into the result buffer in order to persist through the (audit?)

Sorry I'm not more specific here, it's been 6 months since I dug into this... I remember this awesome post had led me to some clarity: https://www.theswamp.org/index.php?topic=27010.msg325377#msg325377



--- Quote from: Keith™ on June 10, 2017, 08:01:50 AM ---
--- Quote from: Keith Brown on June 10, 2017, 07:14:48 AM ---The size of an xrecord is technically unlimited I believe.  The maximum size of a result buffer is I believe 127 bytes.

--- End quote ---

I am reading large files into a resultbuffer and storing them as xRecords
Something like this works without issue


--- Code - C#: ---string Notes = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?";ResultBuffer rb = new ResultBuffer(new TypedValue((int)DxfCode.Text, Notes));
--- End quote ---

Keith Brown:
Hi Will,  good to see you back at the swamp.


I believe that I got this mixed up.  The typedvalue has a maximum chunk size of 127 (of a Byte).  The resultbuffer can contain alot of typedvalues.   As I mentioned in another thread, I can take a memory stream that represents a xml file of over a million lines and break and add it to a resultbuffer in a series of typedvalues of size 127.


This works pretty good for me and is currently out in the public domain in a program that takes CADWorx piping objects and sends them into a Stress Analysis program and then takes the analysis results and brings them back into CADWorx.


** Edited to clarify Byte typed values have a max size of 127 

Keith™:
I have a notepad clone in my latest project that stores documents in drawings.
It has a RichText container that users can type into, format, edit fonts, etc. They can save the document to the hard drive and/or save it in the drawing.

This works without issue and without breaking down the document into smaller chunks. The theoretical limit for a text blob is 65535 (I think).

There is some code here that you can look at

https://www.theswamp.org/index.php?topic=27010.0

and

https://www.theswamp.org/index.php?topic=26687.0

Daniel has tested it to just over 2MB.

huiz:
The max size depends on the type (DXF code) you put in. You should read the DXF Reference. If you use DXF code for strings, it might be 255 char, but elsewhere in the documentation it claims a rise to 2049 char. DXF code 300-309 can be used for arbitrary text strings, but DXF code 1000 can only contain 255 char. Unless the documentation is not corrected at this point and then 2049 chars are available.
So it is not always neccessary to break strings in chunks.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version