MCPcopy Index your code
hub / github.com/OpenFeign/feign / decodeOrDefault

Method decodeOrDefault

core/src/main/java/feign/Util.java:285–295  ·  view source on GitHub ↗
(byte[] data, Charset charset, String defaultValue)

Source from the content-addressed store, hash-verified

283 }
284
285 public static String decodeOrDefault(byte[] data, Charset charset, String defaultValue) {
286 if (data == null) {
287 return defaultValue;
288 }
289 checkNotNull(charset, "charset");
290 try {
291 return charset.newDecoder().decode(ByteBuffer.wrap(data)).toString();
292 } catch (CharacterCodingException ex) {
293 return defaultValue;
294 }
295 }
296
297 /**
298 * If the provided String is not null or empty.

Callers 1

Calls 4

checkNotNullMethod · 0.95
wrapMethod · 0.80
decodeMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected