Tabnine Logo
WsFrameEncodingSupport
Code IndexAdd Tabnine to your IDE (free)

How to use
WsFrameEncodingSupport
in
org.kaazing.gateway.transport.ws.bridge.filter

Best Java code snippets using org.kaazing.gateway.transport.ws.bridge.filter.WsFrameEncodingSupport (Showing top 4 results out of 315)

origin: kaazing/gateway

  private IoBufferEx doMessageEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) {
    if (maskSends) {
      return WsFrameEncodingSupport.doEncode(allocator, flags, message, prng.nextInt());
    } else {
    return WsFrameEncodingSupport.doEncode(allocator, flags, message);
    }
  }
}
origin: kaazing/gateway

final boolean mask = true;
IoBufferEx ioBuf = getBytes(allocator, flags, message);
ByteBuffer buf = ioBuf.buf();
int offset = 2 + (mask ? 4 : 0) + calculateLengthSize(remaining);
  ByteBuffer b = allocator.allocate(offset + remaining, flags);
byte b2 = (byte) (mask ? 0x80 : 0x00);
b1 = doEncodeOpcode(b1, message);
b2 |= lenBits(remaining);
doEncodeLength(b, remaining);
origin: kaazing/gateway

IoBufferEx ioBuf = getBytes(allocator, flags, message);
ByteBuffer buf = ioBuf.buf();
int position = buf.position();
int offset = 2 + (mask ? 4 : 0) + calculateLengthSize(remaining);
if (((flags & FLAG_ZERO_COPY) != 0) && (position >= offset)) {
  if (!isCacheEmpty(message)) {
    throw new IllegalStateException("Cache must be empty: flags = " + flags);
  byte b2 = (byte) (mask ? 0x80 : 0x00);
  b1 = doEncodeOpcode(b1, message);
  b2 |= lenBits(remaining);
  doEncodeLength(b, remaining);
  byte b2 = (byte) (mask ? 0x80 : 0x00);
  b1 = doEncodeOpcode(b1, message);
  b2 |= lenBits(remaining);
  doEncodeLength(b, remaining);
origin: kaazing/gateway

IoBufferEx b = WsFrameEncodingSupport.doEncode(parentAllocator, FLAG_NONE, message);
org.kaazing.gateway.transport.ws.bridge.filterWsFrameEncodingSupport

Most used methods

  • doEncode
    Encode WebSocket message as a single frame, with the provided masking value applied.
  • calculateLengthSize
  • doEncodeLength
  • doEncodeOpcode
    Encode a WebSocket opcode onto a byte that might have some high bits set.
  • getBytes
  • isCacheEmpty
  • lenBits

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now