I added a custom wrapper type and some extension methods, so now I can save byte arrays fast with ES2Writer.SaveBytes and ES2Data.LoadBytes. Speedup is around 10x.
All the best.
Happy new year in advance!
Search found 22 matches
- Thu Dec 26, 2019 5:24 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Best practices for reading and writing byte arrays
- Replies: 5
- Views: 11732
- Wed Dec 25, 2019 11:07 pm
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Best practices for reading and writing byte arrays
- Replies: 5
- Views: 11732
Re: Best practices for reading and writing byte arrays
I suppose one could create a custom ES2Type wrapper class for byte[] that uses writer.WriteRaw for the byte array. Then you would be able to save byte arrays fast and with tag support.
- Tue Dec 24, 2019 9:13 pm
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Best practices for reading and writing byte arrays
- Replies: 5
- Views: 11732
Re: Best practices for reading and writing byte arrays
I need this to be part of a ES2Writer and have it retrievable by ES2Data. Is it not possible to WriteRaw with tag?
- Tue Dec 24, 2019 6:01 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Best practices for reading and writing byte arrays
- Replies: 5
- Views: 11732
Best practices for reading and writing byte arrays
I'm getting some slow performance when reading and writing large byte arrays using ES2. I notice in the code that ES2 seems to write and read/parse one byte at the time using a loop. Clearly, since System.IO.File.ReadAllBytes is much, much faster, ES2 should be able to read and write byte arrays ver...
- Mon Aug 21, 2017 7:12 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Cannot read Vector3 array
- Replies: 3
- Views: 7792
Re: Cannot read Vector3 array
Thanks! That fixed it.
- Mon Aug 21, 2017 4:58 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Cannot read Vector3 array
- Replies: 3
- Views: 7792
Re: Cannot read Vector3 array
Ok, if loading the file directly this error doesn't seem to occur. So I guess EasySave doesn't like TextAssets?
- Mon Aug 21, 2017 4:45 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Cannot read Vector3 array
- Replies: 3
- Views: 7792
Cannot read Vector3 array
I just bumped into this very odd error. Whenever I try to load this Vector3 array, I get an OutOfMemoryException. var bytes = Resources.Load<TextAsset>("bakeData").bytes; var data = ES2Reader.Create(bytes, new ES2Settings { }); var offsets = data.ReadArray<Vector3>(); I'm using the latest ...
- Thu Dec 29, 2016 5:50 pm
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Request - Write / Read from memory
- Replies: 7
- Views: 15970
Re: Request - Write / Read from memory
Any particular reason ReadAll and these create methods are undocumented?
- Thu Dec 29, 2016 5:12 pm
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Request - Write / Read from memory
- Replies: 7
- Views: 15970
Re: Request - Write / Read from memory
Perfect, thanks!
- Thu Dec 29, 2016 2:56 am
- Forum: (Legacy) Easy Save 2 General Discussion
- Topic: Request - Write / Read from memory
- Replies: 7
- Views: 15970
Re: Request - Write / Read from memory
Can you show an explicit example how this is used? I'm having trouble getting it to work. I can't find any stream property of ES2Writer instance, and I can't find anything in the docs.
What I want to do is write to memory, and then read all that from memory into ES2Data.
What I want to do is write to memory, and then read all that from memory into ES2Data.