Examples of encode()


Examples of org.apache.harmony.security.asn1.ASN1SequenceOf.encode()

                // Boolean
                0x01, 0x01, 0x00,
                // Integer
                0x02, 0x01, 0x09 };

        assertTrue("Encoded: ", Arrays.equals(encoded, sequenceOf.encode(list)));

        List values = (List) sequenceOf.decode(encoded);

        assertEquals("Size: ", 2, values.size());
        assertEquals("First: ", Boolean.FALSE, values.get(0));

Examples of org.apache.isis.runtimes.dflt.remoting.common.protocol.PersistenceQueryEncoder.encode()

     * </ul>
     */
    @Override
    public PersistenceQueryData encodePersistenceQuery(final PersistenceQuery criteria) {
        final PersistenceQueryEncoder strategy = findPersistenceQueryEncoder(criteria.getClass());
        return strategy.encode(criteria);
    }

    // /////////////////////////////////////////////////////////
    // client-side decoding
    // /////////////////////////////////////////////////////////

Examples of org.apache.jetspeed.security.CredentialPasswordEncoder.encode()

                    {
                        encodedPassword = ((AlgorithmUpgradeCredentialPasswordEncoder)encoder).encode(credential, password);
                    }
                    else
                    {
                        encodedPassword = encoder.encode(userName, password);
                    }
                }
                if (!credential.getPassword().equals(encodedPassword))
                {
                    setPassword = true;

Examples of org.apache.jmeter.protocol.http.modifier.URLRewritingModifier.encode()

        argumentName.setText(rewritingModifier.getArgumentName());
        pathExt.setSelected(rewritingModifier.isPathExtension());
        pathExtNoEquals.setSelected(rewritingModifier.isPathExtensionNoEquals());
        pathExtNoQuestionmark.setSelected(rewritingModifier.isPathExtensionNoQuestionmark());
        shouldCache.setSelected(rewritingModifier.shouldCache());
        encode.setSelected(rewritingModifier.encode());
        super.configure(el);
    }
}

Examples of org.apache.lucene.facet.encoding.IntEncoder.encode()

      HashMap<String,BytesRef> partitionBytes = new HashMap<String,BytesRef>();
      for (Entry<String,IntsRef> e : partitionOrdinals.entrySet()) {
        String name = e.getKey();
        final IntEncoder encoder = partitionEncoder.get(name);
        final BytesRef bytes = new BytesRef(128); // should be enough for most common applications       
        encoder.encode(e.getValue(), bytes);
        partitionBytes.put(name, bytes);
      }
      return partitionBytes;
    }
   

Examples of org.apache.lucene.facet.encoding.SortingIntEncoder.encode()

        newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())).setMergePolicy(newLogMergePolicy()));
    for (int i = 0; i < data.length; i++) {
      Document doc = new Document();
      if (i == 0) {
        BytesRef buf = new BytesRef();
        encoder.encode(IntsRef.deepCopyOf(data[i]), buf );
        doc.add(new BinaryDocValuesField("f", buf));
      } else {
        doc.add(new BinaryDocValuesField("f", new BytesRef()));
      }
      writer.addDocument(doc);

Examples of org.apache.lucene.facet.encoding.VInt8IntEncoder.encode()

    // cover negative numbers;
    BytesRef bytes = new BytesRef(5);
    IntEncoder enc = new VInt8IntEncoder();
    IntsRef values = new IntsRef(1);
    values.ints[values.length++] = -1;
    enc.encode(values, bytes);
   
    IntDecoder dec = enc.createMatchingDecoder();
    values.length = 0;
    dec.decode(bytes, values);
    assertEquals(1, values.length);

Examples of org.apache.lucene.spatial.geohash.GeoHashUtils.encode()

    TupleEntry argument = functionCall.getArguments();
    Double lat = argument.getDouble( 0 );
    Double lng = argument.getDouble( 1 );

    GeoHashUtils ghu = new GeoHashUtils();
    String geohash = ghu.encode( lat, lng );

    Tuple result = new Tuple();
    result.add( geohash.substring( 0, hash_length ) );
    functionCall.getOutputCollector().add( result );
    }

Examples of org.apache.lucene.util.encoding.IntEncoder.encode()

   
    // cover negative numbers;
    IntEncoder enc = new VInt8IntEncoder();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    enc.reInit(baos);
    enc.encode(-1);
   
    IntDecoder dec = enc.createMatchingDecoder();
    dec.reInit(new ByteArrayInputStream(baos.toByteArray()));
    assertEquals(-1, dec.decode());
  }

Examples of org.apache.lucene.util.encoding.VInt8IntEncoder.encode()

   
    // cover negative numbers;
    IntEncoder enc = new VInt8IntEncoder();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    enc.reInit(baos);
    enc.encode(-1);
   
    IntDecoder dec = enc.createMatchingDecoder();
    dec.reInit(new ByteArrayInputStream(baos.toByteArray()));
    assertEquals(-1, dec.decode());
  }
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.