示例#1
0
 /**
  * Construct a new Frame with the given parameters.
  *
  * @param streamId to include in frame
  * @param type to include in frame
  * @param message to include in frame
  * @return new {@link Frame}
  */
 public static Frame from(long streamId, FrameType type, String message) {
   Frame f = new Frame();
   f.directBuffer = createByteBufferAndEncode(streamId, type, message);
   return f;
 }
示例#2
0
 /**
  * Construct a new Frame from the given ByteBuffer
  *
  * @param byteBuffer to wrap
  * @return new {@link Frame}
  */
 public static Frame from(final ByteBuffer byteBuffer) {
   Frame f = new Frame();
   f.directBuffer = new UnsafeBuffer(byteBuffer);
   return f;
 }