Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBuffer.writeByte()


   * @return a ChannelBuffer with a greeting
   */
  private static ChannelBuffer makeZMTP1Greeting(byte[] localIdentity) {
    ChannelBuffer out = ChannelBuffers.dynamicBuffer();
    ZMTPUtils.encodeLength(localIdentity.length + 1, out);
    out.writeByte(0x00);
    out.writeBytes(localIdentity);
    return out;
  }

}
View Full Code Here


  private ChannelBuffer makeZMTP2Greeting(boolean includeSignature) {
    ChannelBuffer out = ChannelBuffers.dynamicBuffer();
    if (includeSignature) {
      ZMTPUtils.encodeLength(0, out, true);
      // last byte of signature
      out.writeByte(0x7f);
      // protocol revision
    }
    out.writeByte(0x01);
    // socket-type
    ZMTPSocketType socketType = session.getSocketType();
View Full Code Here

      ZMTPUtils.encodeLength(0, out, true);
      // last byte of signature
      out.writeByte(0x7f);
      // protocol revision
    }
    out.writeByte(0x01);
    // socket-type
    ZMTPSocketType socketType = session.getSocketType();
    assert socketType != null;
    out.writeByte(socketType.ordinal());
    // identity
View Full Code Here

    }
    out.writeByte(0x01);
    // socket-type
    ZMTPSocketType socketType = session.getSocketType();
    assert socketType != null;
    out.writeByte(socketType.ordinal());
    // identity
    // the final-short flag octet
    out.writeByte(0x00);
    out.writeByte(session.getLocalIdentity().length);
    out.writeBytes(session.getLocalIdentity());
View Full Code Here

    ZMTPSocketType socketType = session.getSocketType();
    assert socketType != null;
    out.writeByte(socketType.ordinal());
    // identity
    // the final-short flag octet
    out.writeByte(0x00);
    out.writeByte(session.getLocalIdentity().length);
    out.writeBytes(session.getLocalIdentity());
    return out;
  }
View Full Code Here

    assert socketType != null;
    out.writeByte(socketType.ordinal());
    // identity
    // the final-short flag octet
    out.writeByte(0x00);
    out.writeByte(session.getLocalIdentity().length);
    out.writeBytes(session.getLocalIdentity());
    return out;
  }

  /**
 
View Full Code Here

   * message as specified in the Backwards Compatibility section of http://rfc.zeromq.org/spec:15
   */
  private ChannelBuffer makeZMTP2CompatSignature() {
    ChannelBuffer out = ChannelBuffers.dynamicBuffer();
    ZMTPUtils.encodeLength(session.getLocalIdentity().length + 1, out, true);
    out.writeByte(0x7f);
    return out;
  }

  static byte[] parseZMTP2Greeting(ChannelBuffer buffer, boolean expectSignature) throws ZMTPException {
    if (expectSignature) {
View Full Code Here

  @Override
  public ChannelBuffer encode(RotationMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(9);
    buffer.writeFloat(message.getRotation());
    buffer.writeFloat(message.getPitch());
    buffer.writeByte(message.isOnGround() ? 1 : 0);
    return buffer;
  }

}
View Full Code Here

  public ChannelBuffer encode(PlayNoteMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(12);
    buffer.writeInt(message.getX());
    buffer.writeShort(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getInstrument());
    buffer.writeByte(message.getPitch());
    return buffer;
  }

}
View Full Code Here

    ChannelBuffer buffer = ChannelBuffers.buffer(12);
    buffer.writeInt(message.getX());
    buffer.writeShort(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getInstrument());
    buffer.writeByte(message.getPitch());
    return buffer;
  }

}
View Full Code Here

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.