@@ -0,0 +1,1365 @@
+package com.alibaba.json.bvt.issue_3100;%0A%0Aimport com.alibaba.fastjson.serializer.SerializeWriter;%0Aimport com.alibaba.fastjson.util.IOUtils;%0Aimport junit.framework.TestCase;%0Aimport org.junit.Assert;%0A%0Aimport java.lang.reflect.Field;%0A%0Apublic class Issue3160 extends TestCase %7B%0A%0A    public void test_for_issue() throws Exception %7B%0A        String str = createLargeBasicStr();%0A        SerializeWriter writer = new SerializeWriter();%0A        //%E5%86%99%E5%85%A5%E5%A4%A7%E4%BA%8E12K%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%0A        writer.writeString(str);%0A        writer.writeString(str);%0A        byte%5B%5D bytes = writer.toBytes(%22UTF-8%22);%0A        writer.close();%0A%0A        //%E6%A3%80%E6%9F%A5bytesLocal%E5%A4%A7%E5%B0%8F%EF%BC%8C%E5%A6%82%E6%9E%9C%E7%BC%93%E5%AD%98%E6%88%90%E5%8A%9F%E5%BA%94%E8%AF%A5%E5%A4%A7%E4%BA%8E%E7%AD%89%E4%BA%8E%E8%BE%93%E5%87%BA%E7%9A%84bytes%E9%95%BF%E5%BA%A6%0A        Field bytesBufLocalField = SerializeWriter.class.getDeclaredField(%22bytesBufLocal%22);%0A        bytesBufLocalField.setAccessible(true);%0A        ThreadLocal%3Cbyte%5B%5D%3E bytesBufLocal = (ThreadLocal%3Cbyte%5B%5D%3E) bytesBufLocalField.get(null);%0A        byte%5B%5D bytesLocal = bytesBufLocal.get();%0A        Assert.assertNotNull(%22bytesLocal is null%22, bytesLocal);%0A        Assert.assertTrue(%22bytesLocal is smaller than expected%22, bytesLocal.length %3E= bytes.length);%0A%0A    %7D%0A%0A    private String createLargeBasicStr() %7B%0A        String tmp = new String(IOUtils.DIGITS);%0A        StringBuilder builder = new StringBuilder();%0A        for (int i = 0; i %3C 400; i++) %7B%0A            builder.append(tmp);%0A        %7D%0A        return builder.toString();%0A    %7D%0A%7D%0A

add testcase for issue #3160