All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hydraql.shaded.fastjson2.writer.ObjectWriterImplBitSet Maven / Gradle / Ivy

The newest version!
package hydraql.shaded.fastjson2.writer;

import hydraql.shaded.fastjson2.JSONWriter;

import java.lang.reflect.Type;
import java.util.BitSet;

final class ObjectWriterImplBitSet
        extends ObjectWriterBaseModule.PrimitiveImpl {
    static final ObjectWriterImplBitSet INSTANCE = new ObjectWriterImplBitSet();

    @Override
    public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
        if (object == null) {
            jsonWriter.writeNull();
            return;
        }

        BitSet bitSet = (BitSet) object;

        byte[] bytes = bitSet.toByteArray();
        jsonWriter.writeBinary(bytes);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy