Encode and Decode in Memory (Feature request) - WeOnlyDo Discussion board

Encode and Decode in Memory (Feature request) (General questions)

by D Waters, Monday, November 27, 2006, 20:27 (6571 days ago)

WodMailbox has two paticularly objects I regularly use, 'Decoder' and 'Encoder'. However, the only options for the various Methods supplied is to provide an 'InFile' and 'OutFile'. Would it be possible for you to provide an option to do this in memory? I am using this with an application where everything is in a database. It adds extra steps to extract the data from a database into memory, store to a file, and then read from a file back into memory. I would prefer to be able to extract from DB in memory, and process it with the Encode/Decode methods in memory.

Is this easy enough an option to add? with the option to pass the String or Byte Array data in memory, and also to have the result returned in memory. It would be needed across all Encode and Decode methods (Base64,BinHex4,QuotedPrintable,Uudecode).

I actually run into this need across several of the fine components of yours that I use - where my only option is to store to file, or read from file - when I would prefer to work in memory only, and not require the file system for data manipulation (The WebServer control is one example).

Thanks for making such a great product

Re: Encode and Decode in Memory (Feature request)

by wodSupport, Tuesday, November 28, 2006, 01:00 (6570 days ago) @ D Waters

Dave,

I guess we could make it accept a string data - which will cause problems with non-english systems when converted to/from binary.. We could also use byte arrays which will not work on some systems.. Or VARIANTS...

Hmm. What I'm trying to say is that we could add this - just need to agree on the right solution.

But - why don't you dump your stuff to temporary file, encode, and delete the file? Just curious?

Kreso

Re: Encode and Decode in Memory (Feature request)

by D Waters, Tuesday, November 28, 2006, 02:19 (6570 days ago) @ wodSupport

On a secure system, it is desirable not to have data written to disk, at least for my implementation.

I currently am dumping to file, and then loading it right back into memory - would prefer to skip that step, since it was already in memory. Thought it ight be a nice feature add.

Would Byte Array not work? Isn't that what a file is anyway?

Thanks!

Re: Encode and Decode in Memory (Feature request)

by wodSupport, Tuesday, November 28, 2006, 02:49 (6570 days ago) @ D Waters

So you have no problems in converting string to byte array (and vice versa) if needed?

If so, this sounds like most convinient way for our implementation (and for yours I hope)

Kreso

Re: Encode and Decode in Memory (Feature request)

by D Waters, Tuesday, November 28, 2006, 13:54 (6570 days ago) @ wodSupport

Correct - I have no problems coverting Byte Array to String and vice versa. In fact, in one instance I am passing the data to the wodWebServer component's Response.Body property, which accepts Byte Array, so I wouldn't even have to convert it (a bonus). Otherwise, I can easily convert it as needed.

THanks for any help you can provide!

Re: Encode and Decode in Memory (Feature request)

by wodSupport, Wednesday, November 29, 2006, 02:54 (6569 days ago) @ D Waters

Dave,

done. But only for BASE64 and Quoted-Printable at this moment - that was easy. When Binhex and UUdecode are needed, we'll add them too.

Is this ok for you now?

Please request update and try it out!

Kreso

Re: Encode and Decode in Memory (Feature request)

by D Waters, Wednesday, November 29, 2006, 04:56 (6569 days ago) @ wodSupport

Thanks for all the effort! I am testing the new features - but am finding it only works with VERY small files. If I attempt to encode a file that is 5KB in size - no problem. But when I move to a file that is 150KB it crashes. I can use the old process (write to file, read from file) with the same dataset, and it works, so it looks like there is a problem in the new method. I am regualrly working with much larger files (10 or more MB) 100KB is too small.

Not sure if it is a fixable bug? Or just something that can't be done due to other limitation - let me know!

Thanks again!

(Also, to answer your questions Binhex is not important to me today, but UUEn/Decode would be nice to have in memory as well - although the size issue is bigger issue. I use BASE64 and Quoted-Printable most often, UUEncode less, and Binhex not at all (yet).

Re: Encode and Decode in Memory (Feature request)

by wodSupport, Thursday, November 30, 2006, 01:31 (6568 days ago) @ D Waters

Fixed. Please download update. UU is there too.

Kreso