Package net.tomp2p.message.Message

Examples of net.tomp2p.message.Message.Content


   * @param m2
   *            The second message
   */
  private void compareContentTypes(final Message m1, final Message m2) {
    for (int i = 0; i < m1.contentTypes().length; i++) {
      Content type1 = m1.contentTypes()[i];
      Content type2 = m2.contentTypes()[i];
      if (type1 == null) {
        type1 = Content.EMPTY;
      }
      if (type2 == null) {
        type2 = Content.EMPTY;
View Full Code Here


    // payload comes here
    int size;
    PublicKey receivedPublicKey;
    while (contentTypes.size() > 0) {
      Content content = contentTypes.peek();
      LOG.debug("Go for content: {}.", content);
      switch (content) {
      case INTEGER:
        if (buf.readableBytes() < Utils.INTEGER_BYTE_SIZE) {
          return false;
View Full Code Here

    private boolean loop(AlternativeCompositeByteBuf buf) throws InvalidKeyException, SignatureException, IOException {
        MessageContentIndex next;
        while ((next = message.contentReferences().peek()) != null) {
          final int start = buf.writerIndex();
          final Content content = next.content();
            switch (content) {
            case KEY:
                buf.writeBytes(message.key(next.index()).toByteArray());
                message.contentReferences().poll();
                break;
View Full Code Here

     * @return The decoded content types
     */
    public static Content[] decodeContentTypes(int contentTypes, Message message) {
        Content[] result = new Content[Message.CONTENT_TYPE_LENGTH];
        for (int i = 0; i < Message.CONTENT_TYPE_LENGTH; i++) {
            Content content = Content.values()[contentTypes & Utils.MASK_0F];
            result[i] = content;
            if(content == Content.PUBLIC_KEY_SIGNATURE) {
                message.setHintSign();
            }
            contentTypes >>>= 4;
View Full Code Here

TOP

Related Classes of net.tomp2p.message.Message.Content

Copyright © 2018 www.massapicom. 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.