twitter / serial Goto Github PK
View Code? Open in Web Editor NEWLight-weight, fast framework for object serialization in Java, with Android support.
License: Apache License 2.0
Light-weight, fast framework for object serialization in Java, with Android support.
License: Apache License 2.0
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.
Hi, @jingwei423
if there is a clerical error in the translated doc? I'm not sure.
https://github.com/twitter/Serial/blob/master/README-CHINESE.rst/#id7
这个文档中的
Hi all,
it would be nice to have it in maven central to get it like other dependencies.
Thanks
I didn't see Parcelable
mentioned anywhere in your blog post. How is this different/better than Android's Parcelable?
can give some examples?
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!
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.
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.
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.
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)
对于数组list map 相对于gson 没有有啥 50000的量
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.
翻译成kotlin 支持可空的类型 比如Float? Int?
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.