Tabnine Logo
Charsets$CodecsCache
Code IndexAdd Tabnine to your IDE (free)

How to use
Charsets$CodecsCache
in
org.glassfish.grizzly.utils

Best Java code snippets using org.glassfish.grizzly.utils.Charsets$CodecsCache (Showing top 20 results out of 315)

origin: javaee/grizzly

/**
 * Return the {@link Charset}'s {@link CharsetDecoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetDecoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetDecoder}.
 */
public static CharsetDecoder getCharsetDecoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetDecoder decoder = obtainCodecsCache().getDecoder(charset);
  decoder.reset();
  
  return decoder;
}

origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * Return the {@link Charset}'s {@link CharsetEncoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetEncoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetEncoder}.
 */
public static CharsetEncoder getCharsetEncoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetEncoder encoder = obtainCodecsCache().getEncoder(charset);
  encoder.reset();
  
  return encoder;
}
origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: org.glassfish.grizzly/grizzly-http-server-core

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: org.mule.glassfish.grizzly/grizzly-framework

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: org.glassfish.grizzly/grizzly-core

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: javaee/grizzly

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: org.glassfish.grizzly/grizzly-websockets-server

private static Object obtainElementByCharset(final Object[] array,
    final Charset charset, final CharsetCodecResolver resolver) {
  
  int i = 0;
  for (; i < array.length; i++) {
    final Object currentElement = array[i];
    
    if (currentElement == null) {
      i++; // to make 
      break;
    }
    
    if (charset.equals(resolver.charset(currentElement))) {
      makeFirst(array, i, currentElement);
      return currentElement;
    }
  }
  final Object newElement = resolver.newElement(charset);
  makeFirst(array, i - 1, newElement);
  return newElement;            
}

origin: org.glassfish.grizzly/grizzly-core

/**
 * Return the {@link Charset}'s {@link CharsetEncoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetEncoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetEncoder}.
 */
public static CharsetEncoder getCharsetEncoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetEncoder encoder = obtainCodecsCache().getEncoder(charset);
  encoder.reset();
  
  return encoder;
}
origin: javaee/grizzly

/**
 * Return the {@link Charset}'s {@link CharsetEncoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetEncoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetEncoder}.
 */
public static CharsetEncoder getCharsetEncoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetEncoder encoder = obtainCodecsCache().getEncoder(charset);
  encoder.reset();
  
  return encoder;
}
origin: javaee/grizzly

/**
 * Return the {@link Charset}'s {@link CharsetDecoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetDecoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetDecoder}.
 */
public static CharsetDecoder getCharsetDecoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetDecoder decoder = obtainCodecsCache().getDecoder(charset);
  decoder.reset();
  
  return decoder;
}

origin: javaee/grizzly

/**
 * Return the {@link Charset}'s {@link CharsetDecoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetDecoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetDecoder}.
 */
public static CharsetDecoder getCharsetDecoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetDecoder decoder = obtainCodecsCache().getDecoder(charset);
  decoder.reset();
  
  return decoder;
}

origin: org.mule.glassfish.grizzly/grizzly-framework

/**
 * Return the {@link Charset}'s {@link CharsetEncoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetEncoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetEncoder}.
 */
public static CharsetEncoder getCharsetEncoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetEncoder encoder = obtainCodecsCache().getEncoder(charset);
  encoder.reset();
  
  return encoder;
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * Return the {@link Charset}'s {@link CharsetDecoder}.
 * The <tt>Charsets</tt> class maintains the {@link CharsetDecoder} thread-local
 * cache.  Be aware - this shouldn't be used by multiple threads.
 * 
 * @param charset {@link Charset}.
 * @return the {@link Charset}'s {@link CharsetDecoder}.
 */
public static CharsetDecoder getCharsetDecoder(final Charset charset) {
  if (charset == null) {
    throw new IllegalArgumentException("Charset can not be null");
  }
  
  final CharsetDecoder decoder = obtainCodecsCache().getDecoder(charset);
  decoder.reset();
  
  return decoder;
}

org.glassfish.grizzly.utilsCharsets$CodecsCache

Most used methods

  • <init>
  • getDecoder
  • getEncoder
  • makeFirst
  • obtainElementByCharset

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
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