Examples of writeByteArray()


Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray()

        Assert.assertEquals("true", JSON.toJSONString(true));
    }

    public void test_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.writeByteArray(new byte[] { 1, 2, 3 });
        Assert.assertEquals("\"AQID\"", out.toString());
    }

    public void test_2() throws Exception {
        SerializeWriter out = new SerializeWriter(100);
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray()

        Assert.assertEquals("\"AQID\"", out.toString());
    }

    public void test_2() throws Exception {
        SerializeWriter out = new SerializeWriter(100);
        out.writeByteArray(new byte[] { 1, 2, 3 });
        Assert.assertEquals("\"AQID\"", out.toString());
    }
}
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray()

       
        byte[] bytes = "民主共和君主宪".getBytes("GB2312");
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeByteArray(bytes);
        writer.close();
       
        String text = out.toString();
        byte[] result = JSON.parseObject(text, byte[].class);
        Assert.assertEquals("民主共和君主宪", new String(result, "GB2312"));
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray()

       
        byte[] bytes = "民主".getBytes("GB2312");
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeByteArray(bytes);
        writer.close();
       
        String text = out.toString();
        byte[] result = JSON.parseObject(text, byte[].class);
        Assert.assertEquals("民主", new String(result, "GB2312"));
View Full Code Here

Examples of com.google.gwt.dev.util.DiskCache.writeByteArray()

  }

  @Override
  public CachedCompilationUnit asCachedCompilationUnit() {
    DiskCache diskCache = DiskCache.INSTANCE;
    long astToken = diskCache.writeByteArray(Util.getBytes("Dummy AST data"));
    return new CachedCompilationUnit(this, astToken);
  }

  @Override
  public Collection<CompiledClass> getCompiledClasses() {
View Full Code Here

Examples of org.apache.sanselan.common.BinaryOutputStream.writeByteArray()

        { // write Palette
            writer.writePalette(bos);
        }
        { // write Image Data
            bos.writeByteArray(imagedata);
        }
    }

    /**
     * Extracts embedded XML metadata as XML string.
View Full Code Here

Examples of org.apache.sanselan.common.BinaryOutputStream.writeByteArray()

    { // write Palette
      writer.writePalette(bos);
    }
    { // write Image Data
      bos.writeByteArray(imagedata);
    }
  }

}
View Full Code Here

Examples of org.apache.sanselan.common.BinaryOutputStream.writeByteArray()

    { // write Palette
      writer.writePalette(bos);
    }
    { // write Image Data
      bos.writeByteArray(imagedata);
    }
  }

  /**
   * Extracts embedded XML metadata as XML string.
View Full Code Here

Examples of org.apache.sanselan.common.BinaryOutputStream.writeByteArray()

        { // write Palette
            writer.writePalette(bos);
        }
        { // write Image Data
            bos.writeByteArray(imagedata);
        }
    }

    /**
     * Extracts embedded XML metadata as XML string.
View Full Code Here

Examples of org.apache.sanselan.common.BinaryOutputStream.writeByteArray()

        { // write Palette
            writer.writePalette(bos);
        }
        { // write Image Data
            bos.writeByteArray(imagedata);
        }
    }

    /**
     * Extracts embedded XML metadata as XML string.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.