Examples of writeString()


Examples of org.apache.lucene.util.PagedBytes.PagedBytesDataOutput.writeString()

        fieldCounter++;
      }
      TermInfo termInfo = indexEnum.termInfo();
      indexToTerms.set(i, dataOutput.getPosition());
      dataOutput.writeVInt(fieldCounter);
      dataOutput.writeString(term.text());
      dataOutput.writeVInt(termInfo.docFreq);
      if (termInfo.docFreq >= skipInterval) {
        dataOutput.writeVInt(termInfo.skipOffset);
      }
      dataOutput.writeVLong(termInfo.freqPointer);
View Full Code Here

Examples of org.apache.qpid.client.message.JMSStreamMessage.writeString()

    }

    public void testWriteString() throws Exception
    {
        JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
        bm.writeString("Bananas");
        bm.reset();
        String res = bm.readString();
        assertEquals("Bananas", res);
    }
View Full Code Here

Examples of org.apache.thrift.protocol.TBinaryProtocol.writeString()

            // message header length placeholder
            protocol.writeI16( Short.MAX_VALUE );
            // version
            protocol.writeByte( VERSION );
            // service name
            protocol.writeString( serviceName );
            // dubbo request id
            protocol.writeI64( request.getId() );
            protocol.getTransport().flush();
            // header size
            headerLength = bos.size();
View Full Code Here

Examples of org.apache.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

Examples of org.apache.thrift.protocol.TTupleProtocol.writeString()

      if (struct.isSetHost()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetKey()) {
        oprot.writeString(struct.key);
      }
      if (struct.isSetValue()) {
        oprot.writeBinary(struct.value);
      }
      if (struct.isSetAnnotation_type()) {
View Full Code Here

Examples of org.codehaus.activemq.message.ActiveMQStreamMessage.writeString()

  public void testReadString()
  {
    ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
    try {
      byte testByte = (byte)2;
      msg.writeString(new Byte(testByte).toString());
      msg.reset();
      assertTrue(msg.readByte()==testByte);
      msg.clearBody();
      short testShort = 3;
      msg.writeString(new Short(testShort).toString());
View Full Code Here

Examples of org.codehaus.jackson.JsonGenerator.writeString()

        JsonGenerator generator = factory.createJsonGenerator(writer);
        generator.writeStartObject();
        generator.writeFieldName("bool");
        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
        generator.writeFieldName("firstName");
View Full Code Here

Examples of 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 org.eclipse.jgit.transport.PacketLineOut.writeString()

  private static void sendInfoRefsError(HttpServletRequest req,
      HttpServletResponse res, String textForGit) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream(128);
    PacketLineOut pck = new PacketLineOut(buf);
    String svc = req.getParameter("service");
    pck.writeString("# service=" + svc + "\n");
    pck.end();
    pck.writeString("ERR " + textForGit);
    send(req, res, infoRefsResultType(svc), buf.toByteArray());
  }
View Full Code Here

Examples of org.elasticsearch.common.io.stream.BytesStreamOutput.writeString()

        out.writeGenericValue(longArray);
        float[] floatArray = {1.1f, 2.2f, 3.3f};
        out.writeGenericValue(floatArray);
        double[] doubleArray = {1.1, 2.2, 3.3};
        out.writeGenericValue(doubleArray);
        out.writeString("hello");
        out.writeString("goodbye");
        BytesStreamInput in = new BytesStreamInput(out.bytes().toBytes(), false);
        assertThat(in.readBoolean(), equalTo(false));
        assertThat(in.readByte(), equalTo((byte)1));
        assertThat(in.readShort(), equalTo((short)-1));
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.