Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Can't reload saved data #132

Open
thomasd3 opened this issue Dec 17, 2021 · 0 comments
Open

Can't reload saved data #132

thomasd3 opened this issue Dec 17, 2021 · 0 comments

Comments

@thomasd3
Copy link

with this type:

[<ZeroFormattable>]
type SourceCandle =
    {
        [<Index(0)>] t: DateTime        // time
        [<Index(1)>] h: double          // high
        [<Index(2)>] l: double          // low
        [<Index(3)>] m: double          // midpoint
        [<Index(4)>] a: double          // average
        [<Index(5)>] v: double          // volume
        [<Index(6)>] d: double          // direction
    }


and the file attached:
[MKRUSDT.zero.zip](https://github.com/neuecc/ZeroFormatter/files/7735974/MKRUSDT.zero.zip)

you can't deserialize with:

    File.ReadAllBytes(filename)
    |> ZeroFormatterSerializer.Deserialize<SourceCandle array>

even though ZeroFormatter created the file.

The error is:

System.InvalidOperationException: Timestamp contains invalid values: Seconds=7035036171763712001; Nanos=0
   at ZeroFormatter.Internal.BinaryUtil.ReadDateTime(Byte[]& bytes, Int32 offset)
   at ZeroFormatter.Formatters.DateTimeFormatter`1.Deserialize(Byte[]& bytes, Int32 offset, DirtyTracker tracker, Int32& byteSize)
   at ZeroFormatter.DynamicObjectSegments.ZeroFormatter_Formatters_FSharpResolver`1\[\[ZeroFormatter_Formatters_DefaultResolver\, ZeroFormatter\, Version=1_6_4_0\, Culture=neutral\, PublicKeyToken=null\]\].FSI_0006\.SourceCandle$Formatter.Deserialize(Byte[]& , Int32 , DirtyTracker , Int32& )
   at ZeroFormatter.Formatters.ArrayFormatter`2.Deserialize(Byte[]& bytes, Int32 offset, DirtyTracker tracker, Int32& byteSize)
   at ZeroFormatter.ZeroFormatterSerializer.CustomSerializer`1.Deserialize[T](Byte[] bytes)
   at ZeroFormatter.FSharp.CustomSerializer`1.Deserialize[T](Byte[] bytes)
   at ZeroFormatter.FSharp.ZeroFormatterSerializer.Deserialize[T](Byte[] bytes)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant