code: private static CharsetDecoder getDecoder(Charset charset)
      {
          if (charset == null) {
              throw new NullPointerException("charset");
          }
  
          Map<Charset, CharsetDecoder> map = decoders.get();
          CharsetDecoder d = map.get(charset);
          if (d != null) {
              d.reset();
              d.onMalformedInput(CodingErrorAction.REPLACE);
              d.onUnmappableCharacter(CodingErrorAction.REPLACE);
              return d;
          }
  
          d = charset.newDecoder();
          d.onMalformedInput(CodingErrorAction.REPLACE);
          d.onUnmappableCharacter(CodingErrorAction.REPLACE);
          map.put(charset, d);
          return d;
      }
docs: Returns a cached thread-local {@link CharsetDecoder} for the specified
  <tt>charset</tt>.