Examples of encode()


Examples of org.eclipse.jgit.internal.storage.pack.DeltaIndex.encode()

  public void testLimitObjectSize_Length12InsertFails() throws IOException {
    src = getRng().nextBytes(12);
    dst = src;

    DeltaIndex di = new DeltaIndex(src);
    assertFalse(di.encode(actDeltaBuf, dst, src.length));
  }

  @Test
  public void testLimitObjectSize_Length130InsertFails() throws IOException {
    src = getRng().nextBytes(130);

Examples of org.elasticsearch.common.netty.handler.codec.http.CookieEncoder.encode()

                    // Reset the cookies if necessary.
                    CookieEncoder cookieEncoder = new CookieEncoder(true);
                    for (Cookie cookie : cookies) {
                        cookieEncoder.addCookie(cookie);
                    }
                    resp.addHeader(HttpHeaders.Names.SET_COOKIE, cookieEncoder.encode());
                }
            }
        }

        // Write the response.

Examples of org.ethereum.util.Value.encode()

            return EMPTY_TRIE_HASH;
        } else if (root instanceof byte[]) {
            return (byte[]) this.getRoot();
        } else {
            Value rootValue = new Value(this.getRoot());
            byte[] val = rootValue.encode();
            return HashUtil.sha3(val);
        }
    }

    /****************************************
 

Examples of org.exoplatform.commons.utils.CharEncoder.encode()

               case '/' :
                  appendable.append('_');
                  break;
               default :
                  CharEncoder encoder = CharsetCharEncoder.getUTF8();
                  byte[] bytes = encoder.encode(c);
                  appendable.append('%');
                  for (byte b : bytes)
                  {
                     for (char cc : table[b])
                     {

Examples of org.exoplatform.commons.utils.HTMLEntityEncoder.encode()

                String definitionName = application.getDisplayName().replace(' ', '_');
                defaultValue = appRegService.getApplication(category.getName(), definitionName) != null;
            }
            checkBoxInput = new UICheckBoxInput("category_" + category.getName(), null, defaultValue);
            checkBoxInput.setOnChange("SelectBox");
            uiInfo = new UIFormInputInfo("categoryName", null, encoder.encode(category.getDisplayName(true)));
            uiInputSet.addChild(checkBoxInput);
            uiInputSet.addChild(uiInfo);
            uiTableInputSet.addChild(uiInputSet);
            uiInputSetList.add(uiInputSet);
        }

Examples of org.exoplatform.commons.utils.TextEncoder.encode()

            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                TextEncoder encoder = CharsetTextEncoder.getUTF8();
                char[] buffer = new char[256];
                for (int l = script.read(buffer); l != -1; l = script.read(buffer)) {
                    encoder.encode(buffer, 0, l, out);
                }
                return new ScriptResult.Resolved(out.toByteArray());
            } finally {
                Safe.close(script);
            }

Examples of org.fusesource.mqtt.codec.CONNACK.encode()

                    // If the connection attempt fails we close the socket.
                    Throwable exception = ((ExceptionResponse) response).getException();
                    //let the client know
                    CONNACK ack = new CONNACK();
                    ack.code(CONNACK.Code.CONNECTION_REFUSED_SERVER_UNAVAILABLE);
                    getMQTTTransport().sendToMQTT(ack.encode());
                    getMQTTTransport().onException(IOExceptionSupport.create(exception));
                    return;
                }

                final SessionInfo sessionInfo = new SessionInfo(sessionId);

Examples of org.fusesource.mqtt.codec.CONNECT.encode()

        CONNECT connect = new CONNECT();
        connect.cleanSession(true);
        connect.clientId(new UTF8Buffer(""));

        DataByteArrayOutputStream output = new DataByteArrayOutputStream();
        wireFormat.marshal(connect.encode(), output);
        Buffer marshalled = output.toBuffer();

        DataByteArrayInputStream input = new DataByteArrayInputStream(marshalled);
        codec.parse(input, marshalled.length());

Examples of org.fusesource.mqtt.codec.PUBACK.encode()

                            if (response.isException()) {
                                LOG.warn("Failed to send MQTT Publish: ", command, ((ExceptionResponse) response).getException());
                            } else {
                                PUBACK ack = new PUBACK();
                                ack.messageId(command.messageId());
                                converter.getMQTTTransport().sendToMQTT(ack.encode());
                            }
                        }
                    };
                case EXACTLY_ONCE:
                    return new ResponseHandler() {

Examples of org.fusesource.mqtt.codec.PUBCOMP.encode()

        if (ack == null) {
            LOG.warn("Unknown PUBREL: " + command.messageId() + " received");
        }
        PUBCOMP pubcomp = new PUBCOMP();
        pubcomp.messageId(command.messageId());
        sendToMQTT(pubcomp.encode());
    }

    void onMQTTPubComp(PUBCOMP command) {
        short messageId = command.messageId();
        MessageAck ack;
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.