Examples of encode()


Examples of co.nstant.in.cbor.encoder.HalfPrecisionFloatEncoder.encode()

  private boolean isHalfPrecisionEnough(float value) {
    try {
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      HalfPrecisionFloatEncoder encoder = new HalfPrecisionFloatEncoder(
          null, outputStream);
      encoder.encode(new HalfPrecisionFloat(value));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(
          outputStream.toByteArray());
      HalfPrecisionFloatDecoder decoder = new HalfPrecisionFloatDecoder(
          null, inputStream);
      HalfPrecisionFloat halfPrecisionFloat = decoder.decode(0);

Examples of codec.asn1.ASN1Type.encode()

        try {
      out = new ByteArrayOutputStream();
      enc = new DEREncoder(out);

      obj.encode(enc);

      entry = new AVA(key, out.toByteArray(), sibling);

      enc.close();
        } catch (Exception e) {

Examples of com.alibaba.druid.filter.encoding.EncodingConvertFilter.encode()

        Assert.assertFalse(param1.equals(PARAM_VALUE));

        ResultSet rs = stmt.executeQuery();
       
        MyResultSet rawRs = rs.unwrap(MyResultSet.class);
        rawRs.setValue(filter.encode((ConnectionProxy) conn.getConnection(), text));
       
        rs.next();

         Assert.assertEquals(text, rs.getString(1));

Examples of com.alibaba.fastjson.serializer.SerialWriterStringEncoder.encode()

        SerialWriterStringEncoder encoder = new SerialWriterStringEncoder(charsetEncoder);

        Exception error = null;
        char[] chars = "abc".toCharArray();
        try {
            encoder.encode(chars, 0, chars.length);
        } catch (Exception ex) {
            error = ex;
        }
        Assert.assertNotNull(error);
    }

Examples of com.alibaba.rocketmq.common.admin.ConsumeStats.encode()

            consumeTps += consumeStats.getConsumeTps();
            consumeStats.setConsumeTps(consumeTps);
        }

        byte[] body = consumeStats.encode();
        response.setBody(body);
        response.setCode(ResponseCode.SUCCESS);
        response.setRemark(null);
        return response;
    }

Examples of com.alibaba.rocketmq.common.admin.TopicStatsTable.encode()

            topicOffset.setLastUpdateTimestamp(timestamp);

            topicStatsTable.getOffsetTable().put(mq, topicOffset);
        }

        byte[] body = topicStatsTable.encode();
        response.setBody(body);
        response.setCode(ResponseCode.SUCCESS);
        response.setRemark(null);
        return response;
    }

Examples of com.alibaba.rocketmq.common.protocol.body.ClusterInfo.encode()

    public byte[] getAllClusterInfo() {
        ClusterInfo clusterInfoSerializeWrapper = new ClusterInfo();
        clusterInfoSerializeWrapper.setBrokerAddrTable(this.brokerAddrTable);
        clusterInfoSerializeWrapper.setClusterAddrTable(this.clusterAddrTable);
        return clusterInfoSerializeWrapper.encode();
    }


    public void deleteTopic(final String topic) {
        try {

Examples of com.alibaba.rocketmq.common.protocol.body.ConsumeMessageDirectlyResult.encode()

                this.mqClientFactory.consumeMessageDirectly(msg, requestHeader.getConsumerGroup(),
                    requestHeader.getBrokerName());

        if (null != result) {
            response.setCode(ResponseCode.SUCCESS);
            response.setBody(result.encode());
        }
        else {
            response.setCode(ResponseCode.SYSTEM_ERROR);
            response.setRemark(String.format("The Consumer Group <%s> not exist in this consumer",
                requestHeader.getConsumerGroup()));

Examples of com.alibaba.rocketmq.common.protocol.body.ConsumerConnection.encode()

                connection.setClientAddr(RemotingHelper.parseChannelRemoteAddr(info.getChannel()));

                bodydata.getConnectionSet().add(connection);
            }

            byte[] body = bodydata.encode();
            response.setBody(body);
            response.setCode(ResponseCode.SUCCESS);
            response.setRemark(null);

            return response;

Examples of com.alibaba.rocketmq.common.protocol.body.ConsumerRunningInfo.encode()

        ConsumerRunningInfo consumerRunningInfo =
                this.mqClientFactory.consumerRunningInfo(requestHeader.getConsumerGroup());
        if (null != consumerRunningInfo) {
            response.setCode(ResponseCode.SUCCESS);
            response.setBody(consumerRunningInfo.encode());
        }
        else {
            response.setCode(ResponseCode.SYSTEM_ERROR);
            response.setRemark(String.format("The Consumer Group <%s> not exist in this consumer",
                requestHeader.getConsumerGroup()));
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.