Codota Logo
MessageEncoder
Code IndexAdd Codota to your IDE (free)

How to use
MessageEncoder
in
org.kaazing.gateway.transport.bridge

Best Java code snippets using org.kaazing.gateway.transport.bridge.MessageEncoder (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: kaazing/gateway

protected final <T extends Message> IoBufferEx encode(String cacheKey, MessageEncoder<T> encoder, T message, IoBufferAllocatorEx<?> allocator, int flags) {
  ConcurrentMap<String, IoBufferEx> cache = message.getCache();
  
  // if cache is not initialized, throw exception (caller should guard)
  if (cache == null) {
    throw new IllegalStateException("Cache not initialized");
  }
  // lookup existing cached encoding entry
  IoBufferEx cachedBuffer = cache.get(cacheKey);
  if (cachedBuffer == null) {
    // when cachedBuffer is null, perform encode, then cache the result
    // with standard atomic race condition awareness (put-if-absent)            
    if ((flags & FLAG_ZERO_COPY) != 0) {
      if (!cache.isEmpty()) {
        flags &= ~FLAG_ZERO_COPY;
      }
    }
    IoBufferEx newCachedBuffer = encoder.encode(allocator, message, flags);
    if (newCachedBuffer instanceof MessageBuffer<?>) {
      MessageBuffer<?> cacheableBuffer = (MessageBuffer<?>) newCachedBuffer;
      cacheableBuffer.setAutoCache(true);
    }
    cachedBuffer = cache.putIfAbsent(cacheKey, newCachedBuffer);
    if (cachedBuffer == null) {
      cachedBuffer = newCachedBuffer;
    }
  }
  return cachedBuffer;
}
origin: kaazing/gateway

content = contentMessageEncoder.encode(allocator, httpContent, FLAG_NONE);
origin: kaazing/gateway

content = contentMessageEncoder.encode(allocator, httpContent, FLAG_NONE);
org.kaazing.gateway.transport.bridgeMessageEncoder

Most used methods

  • encode

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getExternalFilesDir (Context)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now