Examples of encode()


Examples of org.jredis.semantics.KeyCodec.encode()

  public FutureStatus mset(Map<String, byte[]> keyValueMap){
    KeyCodec codec = DefaultKeyCodec.provider();
    byte[][] mappings = new byte[keyValueMap.size()*2][];
    int i = 0;
    for (Entry<String, byte[]> e : keyValueMap.entrySet()){
      mappings[i++] = codec.encode(e.getKey());
      mappings[i++] = e.getValue();
    }
    return mset(mappings);
  }
 

Examples of org.jruby.RubyString.encode()

        if (value == null || !value.isTrue()) return defaultValue;

        RubyString str = value.convertToString();
        RuntimeInfo info = getRuntimeInfo();
        if (info.encodingsSupported() && str.encoding(context) != info.utf8.get()) {
            str = (RubyString)str.encode(context, info.utf8.get());
        }
        return str;
    }

    /**
 

Examples of org.jscep.message.PkiMessageEncoder.encode()

  X500Name name = new X500Name("CN=jscep.org");
  BigInteger serialNumber = BigInteger.ONE;
  IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name,
    serialNumber);
  GetCert getCert = new GetCert(transId, senderNonce, iasn);
  PkiOperationRequest req = new PkiOperationRequest(enc.encode(getCert));

  try {
      transport.sendRequest(req, new PkiOperationResponseHandler());
  } catch (TransportException e) {
      Assert.assertEquals(e.getMessage(), "404 Not Found");

Examples of org.jscsi.scsi.protocol.inquiry.StandardInquiryData.encode()

      // Decode
      sid.decode(ByteBuffer.wrap(byteOut.toByteArray()));

      // Decode encoded
      sid.decode(ByteBuffer.wrap(sid.encode()));

      // Compare t10VendorIdentification
      byte[] returnedT10VendorIdentification = sid.getT10VendorIdentification();
      assertTrue(Arrays.equals(returnedT10VendorIdentification, t10VendorIdentification));

Examples of org.jscsi.scsi.protocol.inquiry.vpd.VPDPage.encode()

         VPDPage vpdPage = getInquiryDataRegistry().getVPDPage(inquiryCDB.getPageCode());
         if (vpdPage != null)
         {
            try
            {
               this.writeData(vpdPage.encode());
            }
            catch (IOException e)
            {
               _logger.debug("cound not encode vpd page in task: " + this);
               throw new RuntimeException("Could not encode VPD page", e);

Examples of org.jscsi.scsi.protocol.sense.FixedSenseData.encode()

   {
      // FIXME: Currently we hard code always returning fixed sense data
      SenseData data =
            new FixedSenseData(this.current, this.kcq, this.getInformation(),
                  this.getCommandSpecificInformation(), this.getSenseKeySpecific());
      return data.encode();
   }

   public static SenseException decode(ByteBuffer senseData) throws BufferUnderflowException,
         IOException
   {

Examples of org.jscsi.scsi.protocol.sense.SenseData.encode()

   {
      // FIXME: Currently we hard code always returning fixed sense data
      SenseData data =
            new FixedSenseData(this.current, this.kcq, this.getInformation(),
                  this.getCommandSpecificInformation(), this.getSenseKeySpecific());
      return data.encode();
   }

   public static SenseException decode(ByteBuffer senseData) throws BufferUnderflowException,
         IOException
   {

Examples of org.jscsi.scsi.protocol.sense.additional.SenseKeySpecificField.encode()

         out.writeByte(10); // no "Additional sense bytes" will be written, last byte is #17
         out.write(cmdi);
         out.writeByte(kcq.code());
         out.writeByte(kcq.qualifier());
         out.writeByte(0);
         out.write(field.encode());

         assert bs.toByteArray().length == FIXED_SENSE_DATA_LENGTH : "Invalid encoded sense data";
      }
      catch (IOException e)
      {

Examples of org.jtester.json.encoder.JSONEncoder.encode()

    StringWriter writer = new StringWriter();
    JSONEncoder encoder = JSONEncoder.get(object.getClass());
    encoder.setFeatures(features);

    List<String> references = new ArrayList<String>();
    encoder.encode(object, writer, references);
    String json = writer.toString();
    return json;
  }
}

Examples of org.jwall.web.audit.util.Base64Codec.encode()

        byte[] data = evt.toString().getBytes();
        String hash = "md5:"+MD5.md5( data );

        String sum = ConcurrentAuditWriter.createSummary( evt );
        Base64Codec codec = new Base64Codec();
        String cred = new String( codec.encode( ( user + ":" + pass ).getBytes() ) );
        String ua = "jwall.org/Collector Version " + Collector.VERSION;
        Socket sock = this.getSocketConnection();

        try {
           
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.