Returns an instance of this class. @param value value @return instance
(final byte[] value)
| 62 | * @return instance |
| 63 | */ |
| 64 | public static Str get(final byte[] value) { |
| 65 | final int vl = value.length; |
| 66 | if(vl == 0) return EMPTY; |
| 67 | if(vl == 1) return CHAR[value[0]]; |
| 68 | if(vl > 4 || vl > Token.cl(value, 0)) return new Str(value); |
| 69 | // cache single characters |
| 70 | synchronized(CACHE) { |
| 71 | return CACHE.computeIfAbsent(Token.cp(value, 0), () -> new Str(value)); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Returns an instance of this class. |