Examples of writeString()


Examples of com.alibaba.druid.support.json.JSONWriter.writeString()

            if (value == null) {
                out.writeNull();
            } else if (value instanceof String) {
                String text = (String) value;
                if (text.length() > 100) {
                    out.writeString(text.substring(0, 97) + "...");
                } else {
                    out.writeString(text);
                }
            } else if (value instanceof Number) {
                out.writeObject(value);
View Full Code Here

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

   
    public void test_5() throws Exception {
        SerializeWriter out = new SerializeWriter(1000);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.config(SerializerFeature.WriteTabAsSpecial, true);
        out.writeString("\t\n \b\n\r\f\\ \"");
        Assert.assertEquals("\"\\t\\n \\b\\n\\r\\f\\\\ \\\"\"", out.toString());
    }
}
View Full Code Here

Examples of com.caucho.hessian.io.Hessian2Output.writeString()

      Hessian2Output hos = FileTools.getOutputStream(fileName);
     
      //=======================================================//
      /* public static final String wireEnumeratorVersion;     */
      //=======================================================//
      hos.writeString(wireEnumeratorVersion);
     
      //=======================================================//
      /* private HashMap<String,Integer> wireMap;              */
      //=======================================================//
           // We'll rebuild this from wireArray
View Full Code Here

Examples of com.esotericsoftware.kryo.io.Output.writeString()

    runStringTest(new Output(897));
    runStringTest(new Output(new ByteArrayOutputStream()));

    Output write = new Output(21);
    String value = "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234";
    write.writeString(value);
    Input read = new Input(write.toBytes());
    assertEquals(value, read.readString());

    runStringTest(127);
    runStringTest(256);
View Full Code Here

Examples of com.esotericsoftware.kryo.io.UnsafeMemoryOutput.writeString()

    runStringTest(new UnsafeMemoryOutput(897));
    runStringTest(new UnsafeMemoryOutput(new ByteArrayOutputStream()));

    UnsafeMemoryOutput write = new UnsafeMemoryOutput(21);
    String value = "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234";
    write.writeString(value);
    Input read = new UnsafeMemoryInput(write.toBytes());
    assertEquals(value, read.readString());

    runStringTest(127);
    runStringTest(256);
View Full Code Here

Examples of com.esotericsoftware.kryo.io.UnsafeOutput.writeString()

    runStringTest(new UnsafeOutput(897));
    runStringTest(new UnsafeOutput(new ByteArrayOutputStream()));

    UnsafeOutput write = new UnsafeOutput(21);
    String value = "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234";
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());

    runStringTest(127);
    runStringTest(256);
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TTupleProtocol.writeString()

      oprot.writeBitSet(optionals, 3);
      if (struct.isSetField1()) {
        oprot.writeI32(struct.field1);
      }
      if (struct.isSetField2()) {
        oprot.writeString(struct.field2);
      }
      if (struct.isSetField3()) {
        {
          oprot.writeI32(struct.field3.size());
          for (InnerStruct _iter4 : struct.field3)
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.util.TokenBuffer.writeString()

        /* Ok: time to mix type id, value; and we will actually use "wrapper-array"
         * style to ensure we can handle all kinds of JSON constructs.
         */
        TokenBuffer merged = new TokenBuffer(jp.getCodec());
        merged.writeStartArray();
        merged.writeString(_typeIds[index]);
        JsonParser p2 = _tokens[index].asParser(jp);
        p2.nextToken();
        merged.copyCurrentStructure(p2);
        merged.writeEndArray();
        // needs to point to START_OBJECT (or whatever first token is)
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.util.TokenBuffer.writeString()

            int index, String typeId)
        throws IOException, JsonProcessingException
    {
        TokenBuffer merged = new TokenBuffer(jp.getCodec());
        merged.writeStartArray();
        merged.writeString(typeId);
        JsonParser p2 = _tokens[index].asParser(jp);
        p2.nextToken();
        merged.copyCurrentStructure(p2);
        merged.writeEndArray();
View Full Code Here

Examples of com.facebook.thrift.protocol.TProtocol.writeString()

  }

  public static void testNakedString(String str) throws Exception {
    TMemoryBuffer buf = new TMemoryBuffer(0);
    TProtocol proto = factory.getProtocol(buf);
    proto.writeString(str);
    // System.out.println(buf.inspect());
    String out = proto.readString();
    if (!str.equals(out)) {
      throw new RuntimeException("String was supposed to be '" + str + "' but was '" + out + "'");
    }
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.