@Test public void testDecodeObjects() throws Exception { final URLCodec urlCodec = new URLCodec(); final String plain = "Hello+there%21"; String decoded = (String) urlCodec.decode((Object) plain); assertEquals("Basic URL decoding test", "Hello there!", decoded); final byte[] plainBA = plain.getBytes(Charsets.UTF_8); final byte[] decodedBA = (byte[]) urlCodec.decode((Object) plainBA); decoded = new String(decodedBA); assertEquals("Basic URL decoding test", "Hello there!", decoded); final Object result = urlCodec.decode((Object) null); assertEquals( "Decoding a null Object should return null", null, result); try { final Object dObj = new Double(3.0); urlCodec.decode( dObj ); fail( "Trying to url encode a Double object should cause an exception."); } catch (final DecoderException ee) { } this.validateState(urlCodec); }
@Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeUrl(bytes); }
URLCodec implements BinaryEncoder, BinaryDecoder, StringEncoder, StringDecoder { @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeUrl(bytes); } }
URLCodec implements BinaryEncoder, BinaryDecoder, StringEncoder, StringDecoder { @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeUrl(bytes); } URLCodec();  URLCodec(final String charset); }
URLCodec implements BinaryEncoder, BinaryDecoder, StringEncoder, StringDecoder { @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeUrl(bytes); } URLCodec();  URLCodec(final String charset); static final byte[] encodeUrl(BitSet urlsafe, final byte[] bytes); static final byte[] decodeUrl(final byte[] bytes); @Override byte[] encode(final byte[] bytes); @Override byte[] decode(final byte[] bytes); String encode(final String str, final String charset); @Override String encode(final String str); String decode(final String str, final String charset); @Override String decode(final String str); @Override Object encode(final Object obj); @Override Object decode(final Object obj); String getDefaultCharset(); @Deprecated String getEncoding(); }
URLCodec implements BinaryEncoder, BinaryDecoder, StringEncoder, StringDecoder { @Override public byte[] decode(final byte[] bytes) throws DecoderException { return decodeUrl(bytes); } URLCodec();  URLCodec(final String charset); static final byte[] encodeUrl(BitSet urlsafe, final byte[] bytes); static final byte[] decodeUrl(final byte[] bytes); @Override byte[] encode(final byte[] bytes); @Override byte[] decode(final byte[] bytes); String encode(final String str, final String charset); @Override String encode(final String str); String decode(final String str, final String charset); @Override String decode(final String str); @Override Object encode(final Object obj); @Override Object decode(final Object obj); String getDefaultCharset(); @Deprecated String getEncoding();  }