class ObjectWriterImplInt16ValueArray
        extends ObjectWriterPrimitiveImpl {
    static final ObjectWriterImplInt16ValueArray INSTANCE = new ObjectWriterImplInt16ValueArray(null);
    static final byte[] JSONB_TYPE_NAME_BYTES = JSONB.toBytes("[S");
    static final long JSONB_TYPE_HASH = Fnv.hashCode64("[S");

    private final Function<Object, short[]> function;

    public ObjectWriterImplInt16ValueArray(Function<Object, short[]> function) {
        this.function = function;
    }

    @Override
    public void writeJSONB(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
        if (jsonWriter.isWriteTypeInfo(object, fieldType)) {
            jsonWriter.writeTypeName(JSONB_TYPE_NAME_BYTES, JSONB_TYPE_HASH);
        }

        short[] shorts;
        if (function != null && object != null) {
            shorts = function.apply(object);
        } else {
            shorts = (short[]) object;
        }

        boolean writeAsString = (features & WriteNonStringValueAsString.mask) != 0;
        if (writeAsString) {
            jsonWriter.writeString(shorts);
            return;
        }

        jsonWriter.writeInt16(shorts);
    }

    @Override
    public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {<FILL_FUNCTION_BODY>}
}

        if (object == null) {
            jsonWriter.writeNull();
            return;
        }

        short[] shorts;
        if (function != null) {
            shorts = function.apply(object);
        } else {
            shorts = (short[]) object;
        }

        boolean writeAsString = (features & WriteNonStringValueAsString.mask) != 0;
        if (writeAsString) {
            jsonWriter.writeString(shorts);
            return;
        }

        jsonWriter.writeInt16(shorts);
    
<methods>public non-sealed void <init>() ,public Function#RAW getFunction() ,public void writeArrayMapping(com.alibaba.fastjson2.JSONWriter, java.lang.Object, java.lang.Object, java.lang.reflect.Type, long) ,public void writeArrayMappingJSONB(com.alibaba.fastjson2.JSONWriter, java.lang.Object, java.lang.Object, java.lang.reflect.Type, long) <variables>