Examples of encode()


Examples of com.gloopics.g3viewer.client.canvas.Canvas.encode()

    float heightRatio = imageHeight/((float)m_ResizeOptions.getMaxHeight());
   
    if (widthRatio > heightRatio){
      if (widthRatio > 1) {
        upThumb.resize(m_ResizeOptions.getMaxWidth(), (int)(imageHeight / widthRatio) );
        m_UploadFile.uploadBlob(upThumb.encode());
        return;
      }
      m_UploadFile.uploadBlob(m_Blob);
    }
    else

Examples of com.google.code.yanf4j.core.CodecFactory.Encoder.encode()

    @Test
    public void testEncodeNormal() throws Exception {
        Encoder encoder = this.codecFactory.getEncoder();
        Assert.assertNotNull(encoder);
        IoBuffer buffer = encoder.encode(IoBuffer.wrap("hello".getBytes("utf-8")), null);
        Assert.assertNotNull(buffer);
        Assert.assertTrue(buffer.hasRemaining());
        Assert.assertArrayEquals("hello".getBytes("utf-8"), buffer.array());

    }

Examples of com.google.common.io.BaseEncoding.encode()

     */
    public String semanticHashString(Trip trip) {
        HashFunction murmur = Hashing.murmur3_32();
        BaseEncoding encoder = BaseEncoding.base64Url().omitPadding();
        StringBuilder sb = new StringBuilder(50);
        sb.append(encoder.encode(stopPattern.semanticHash(murmur).asBytes()));
        if (trip != null) {
            TripTimes tripTimes = scheduledTimetable.getTripTimes(trip);
            if (tripTimes == null) return null;
            sb.append(':');
            sb.append(encoder.encode(tripTimes.semanticHash(murmur).asBytes()));

Examples of com.google.web.bindery.requestfactory.shared.DefaultProxyStore.encode()

    String key = s.serialize(proxy);
    assertNotNull(key);

    // Use a new instance
    store = new DefaultProxyStore(store.encode());
    s = req.getSerializer(store);
    T restored = s.deserialize(id.getProxyClass(), key);
    AutoBean<? extends BaseProxy> restoredBean = AutoBeanUtils.getAutoBean(restored);
    assertNotSame(proxy, restored);
    /*
 

Examples of com.google.zxing.MultiFormatWriter.encode()

        // set values
        final String type = this.params.getType().toString();
       
        // create code image 
        final BitMatrix matrix = writer.encode(
                payload,
                this.params.getFormat(),
                this.params.getWidth(),
                this.params.getHeight(),
                writerHintMap);

Examples of com.google.zxing.Writer.encode()

            Map<EncodeHintType, Object> hints = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
            hints.put(EncodeHintType.CHARACTER_SET, "ISO-8859-1");
            QRCode code = Encoder.encode(paymentString, ErrorCorrectionLevel.M, hints);
            hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
            barsize = size / (code.getMatrix().getWidth() + 8);
            matrix = writer.encode(paymentString, com.google.zxing.BarcodeFormat.QR_CODE, w, h, hints);
        } catch (com.google.zxing.WriterException e) {
            System.out.println(e.getMessage());
        }

        if (matrix == null || barsize < 0) {

Examples of com.google.zxing.qrcode.QRCodeWriter.encode()

  public BufferedImage encode(String data) {
    // get a byte matrix for the data
    BitMatrix matrix;
    com.google.zxing.Writer writer = new QRCodeWriter();
    try {
      matrix = writer.encode(data, com.google.zxing.BarcodeFormat.QR_CODE, width, height);
    } catch (com.google.zxing.WriterException e) {
      // exit the method
      return null;
    }

Examples of com.itextpdf.text.pdf.qrcode.QRCodeWriter.encode()

     * @throws WriterException
     */
    public BarcodeQRCode(String content, int width, int height, Map<EncodeHintType,Object> hints) {
        try {
            QRCodeWriter qc = new QRCodeWriter();
            bm = qc.encode(content, width, height, hints);
        }
        catch (WriterException ex) {
            throw new ExceptionConverter(ex);
        }
    }

Examples of com.jetdrone.vertx.yoke.security.JWT.encode()

                .putNumber("uid", 0)
                .putNumber("iat", now)
                .putNumber("exp", now + 24*60*60*1000)
                .putArray("claims", new JsonArray().add("a").add("b"));

        String token = jwt.encode(json);

        assertTrue(!token.contains("\n"));

        JsonObject decoded = jwt.decode(token);

Examples of com.jitlogic.zorka.core.integ.NrpePacket.encode()

    @Test
    public void testEncodeAndDecodePacket() throws Exception{
        NrpePacket pkt = NrpePacket.newInstance((short)2, (short)1, (short)1, "oja!");
        ByteArrayOutputStream os = new ByteArrayOutputStream(1036);

        pkt.encode(os);
        byte[] buf = os.toByteArray();
        assertEquals(1036, buf.length);

        NrpePacket pkt2 = NrpePacket.fromStream(new ByteArrayInputStream(buf));
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.