Coder Social home page Coder Social logo

serial's Issues

Using Serial for classes where you don't own the super class

Reading through the description and attempting an initial test, it is unclear how I would use this to serialize a custom View or ViewGroup for example? When a super class that I don't own has properties, how would I get these properly serialized using this library - or is the intent of this library only for class hierarchies completely under the control of the developer?

What I'm actually trying to do is serialize the contents of my custom "SavedState" class that extends View.BaseSavedState - I have this working fine for saving/restoring state during configuration changes in the same app, but I also need to persist this state so I can transfer it to another instance of the app and re-create the View properly there.

Serial vs Parcelable

I didn't see Parcelable mentioned anywhere in your blog post. How is this different/better than Android's Parcelable?

Source code not distributed with library artifacts

Hi 😄 When I import the Serial dependency with gradle, I'm not getting source code included. IDEA shows decompiled bytecode when browsing a class.

Can you add this? Helps when debugging, also when the IDE generates code it's nice to have the real parameter names populated instead of p0 p1 p2 etc.

Thanks!

Stability for production

Hi,

Reading over what you have written this seems to solve a lot of headaches using frameworks you have mentioned that I have dealt with in the past.

I am about to start another project in android with a custom file format of my own and I am wondering if you feel this code is production ready?

Thanks.

getMapSerializer Example

Can someone please share an example of how to getMapSerializer. How can I get Serialzer for the Integer for a Map<Integer, List>... thanks in advance.

Does Serial Only for android projects

Hi, @cesar1000
I wanna to use this serializer in my middleware project by java, but after read over a set of related documents, I‘m not sure whether it fits in non-android project.
Can you please give me some suggestions?

thanks.

I am getting ava.lang.OutOfMemoryError: Java heap space during the Serialization... any clues?

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerOutput.ensureCapacity(ByteBufferSerializerOutput.java:244)
at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerOutput.encodeString(ByteBufferSerializerOutput.java:264)
at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerOutput.writeString(ByteBufferSerializerOutput.java:152)
at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerOutput.writeString(ByteBufferSerializerOutput.java:33)
at com.irteqa.db.model.TripData$TripDataSerializer.serializeObject(TripData.java:46)
at com.irteqa.db.model.TripData$TripDataSerializer.serializeObject(TripData.java:31)
at com.twitter.serial.serializer.ObjectSerializer.serialize(ObjectSerializer.java:68)
at com.twitter.serial.serializer.CollectionSerializers.serializeList(CollectionSerializers.java:119)
at com.twitter.serial.serializer.CollectionSerializers.access$000(CollectionSerializers.java:38)
at com.twitter.serial.serializer.CollectionSerializers$1.serializeObject(CollectionSerializers.java:50)
at com.twitter.serial.serializer.CollectionSerializers$1.serializeObject(CollectionSerializers.java:46)
at com.twitter.serial.serializer.ObjectSerializer.serialize(ObjectSerializer.java:68)
at com.twitter.serial.serializer.CollectionSerializers.serializeMap(CollectionSerializers.java:173)
at com.twitter.serial.serializer.CollectionSerializers.access$400(CollectionSerializers.java:38)
at com.twitter.serial.serializer.CollectionSerializers$3.serializeObject(CollectionSerializers.java:100)
at com.twitter.serial.serializer.CollectionSerializers$3.serializeObject(CollectionSerializers.java:95)
at com.twitter.serial.serializer.ObjectSerializer.serialize(ObjectSerializer.java:68)
at com.twitter.serial.stream.SerializerOutput.writeObject(SerializerOutput.java:57)

changes to continuous integration

We will be dropping our paid Travis CI plan at the end of 2021. We do not expect there to be any visible changes to this repo, but wanted to give some notice just in case. We recommend migrating CI jobs to GitHub Actions.

Travis CI provides free testing for open source projects. In addition, Twitter has paid for a small number of additional concurrent builds which were available for open source as well as private repositories. Many Twitter projects have already moved to GitHub Actions for CI, and we have no private repos left using Travis, so we will be discontinuing our plan at the end of 2021.

Since this repo is open source, we do not expect this change to impact Travis CI builds for this project. However, we still recommend most Twitter projects to migrate to GitHub Actions for CI at your convenience.

Can't deserialize - Unknown type 26

I've implemented pretty simple ObjectSerializer and getting following exception after killing/restarting the app:

 Got exception: com.twitter.serial.util.SerializationException: Expected value of type string but found unknown (26).
                                                                  com.twitter.serial.util.SerializationException: Expected value of type string but found unknown (26).
                                                                      at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerInput.reportUnexpectedHeader(ByteBufferSerializerInput.java:221)
                                                                      at com.twitter.serial.stream.bytebuffer.ByteBufferSerializerInput.readString(ByteBufferSerializerInput.java:117)
                                                                      at org.moire.ultrasonic.cache.serializers.DomainSerializers__ArtistSerializerKt$artistSerializer$1.deserializeObject(ArtistSerializer.kt:44)
                                                                      at org.moire.ultrasonic.cache.serializers.DomainSerializers__ArtistSerializerKt$artistSerializer$1.deserializeObject(ArtistSerializer.kt:18)
                                                                      at com.twitter.serial.serializer.ObjectSerializer.deserialize(ObjectSerializer.java:88)
                                                                      at com.twitter.serial.serializer.CollectionSerializers.deserializeList(CollectionSerializers.java:134)
                                                                      at com.twitter.serial.serializer.CollectionSerializers.access$100(CollectionSerializers.java:38)
                                                                      at com.twitter.serial.serializer.CollectionSerializers$1.deserializeObject(CollectionSerializers.java:57)
                                                                      at com.twitter.serial.serializer.CollectionSerializers$1.deserializeObject(CollectionSerializers.java:46)
                                                                      at com.twitter.serial.serializer.ObjectSerializer.deserialize(ObjectSerializer.java:88)
                                                                      at com.twitter.serial.stream.SerializerInput.readObject(SerializerInput.java:62)
                                                                      at org.moire.ultrasonic.cache.serializers.DomainSerializers__IndexesSerializerKt$indexesSerializer$1.deserializeObject(IndexesSerializer.kt:40)
                                                                      at org.moire.ultrasonic.cache.serializers.DomainSerializers__IndexesSerializerKt$indexesSerializer$1.deserializeObject(IndexesSerializer.kt:15)
                                                                      at com.twitter.serial.serializer.ObjectSerializer.deserialize(ObjectSerializer.java:88)
                                                                      at com.twitter.serial.stream.bytebuffer.ByteBufferSerial.fromByteArray(ByteBufferSerial.java:107)
                                                                      at org.moire.ultrasonic.cache.PermanentFileStorage.load(PermanentFileStorage.kt:54)
                                                                      at org.moire.ultrasonic.service.RESTMusicService.getIndexes(RESTMusicService.java:181)
                                                                      at org.moire.ultrasonic.service.CachedMusicService.getIndexes(CachedMusicService.java:135)
                                                                      at org.moire.ultrasonic.activity.SelectArtistActivity$2.doInBackground(SelectArtistActivity.java:160)
                                                                      at org.moire.ultrasonic.activity.SelectArtistActivity$2.doInBackground(SelectArtistActivity.java:143)
                                                                      at org.moire.ultrasonic.util.TabActivityBackgroundTask$1.run(TabActivityBackgroundTask.java:37)

I've looked into SerializerDefs and, indeed, can't find such type.

Here is serialized file: failed.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.