Searched refs:decode (Results 1 - 25 of 86) sorted by relevance

1234

/libcore/ojluni/src/main/java/sun/nio/cs/
H A DArrayDecoder.java34 int decode(byte[] src, int off, int len, char[] dst); method in interface:ArrayDecoder
/libcore/luni/src/test/java/libcore/libcore/util/
H A DHexEncodingTest.java22 import static libcore.util.HexEncoding.decode;
30 assertArraysEqual(avocados, decode(encode(avocados), false));
32 assertArraysEqual(avocados, decode("61766f6361646f73".toCharArray(), false));
36 assertArraysEqual(new byte[] { 6 }, decode("6".toCharArray(), true));
37 assertArraysEqual(new byte[] { 6, 'v' }, decode("676".toCharArray(), true));
42 decode("676".toCharArray(), false);
50 decode("DEADBARD".toCharArray(), false);
56 // commons uses Character.isDigit and would successfully decode a string with
59 decode("६१٧٥٥F6361646F73".toCharArray(), false);
65 decode("#
[all...]
/libcore/luni/src/main/java/libcore/util/
H A DHexEncoding.java64 public static byte[] decode(String encoded) throws IllegalArgumentException { method in class:HexEncoding
65 return decode(encoded.toCharArray());
75 public static byte[] decode(String encoded, boolean allowSingleChar) throws IllegalArgumentException { method in class:HexEncoding
76 return decode(encoded.toCharArray(), allowSingleChar);
85 public static byte[] decode(char[] encoded) throws IllegalArgumentException { method in class:HexEncoding
86 return decode(encoded, false);
96 public static byte[] decode(char[] encoded, boolean allowSingleChar) throws IllegalArgumentException { method in class:HexEncoding
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
H A DURLDecoderTest.java38 * java.net.URLDecoder#decode(java.lang.String)
44 assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode(
46 assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode(
48 assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode(
53 * java.net.URLDecoder#decode(java.lang.String, java.lang.String)
58 URLDecoder.decode("", "");
/libcore/luni/src/test/java/libcore/java/nio/charset/
H A DModifiedUtf8Test.java32 assertEquals("A", ModifiedUtf8.decode(new byte[] { 'A' }, new char[1], 0, 1));
36 assertEquals("BC", ModifiedUtf8.decode(
43 ModifiedUtf8.decode(new byte[]{'B', (byte) 0xc2}, new char[2], 0, 2);
53 ModifiedUtf8.decode(
62 assertEquals("B\u00a0", ModifiedUtf8.decode(
70 assertEquals("B\u0830", ModifiedUtf8.decode(
79 ModifiedUtf8.decode(new byte[]{'A', (byte) 0xf0}, new char[2], 0, 2);
87 assertEquals("A\u00a6", ModifiedUtf8.decode(
92 assertEquals("A\u00bf", ModifiedUtf8.decode(
98 assertEquals("A\u0606", ModifiedUtf8.decode(
[all...]
H A DOldCharsetEncoderDecoderBufferTest.java33 * (CharsetDecoderICU) when a decode operation
43 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'a', (byte)'b', (byte)'c', (byte)'d'}),
53 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'x'}), out, true);
58 // check if the first buffer was corrupted by the second decode
65 * (CharsetDecoderICU) when a decode operation
76 decoder.decode(inWithArray, out, false);
83 decoder.decode(inWithoutArray, out, true);
85 // check whether the first buffer was corrupted by the second decode
116 // check whether the second decode corrupted the first buffer
143 // check whether the second decode corrupte
[all...]
H A DCharsetDecoderTest.java36 assertEquals("\u6d61x", d.decode(in).toString());
46 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true);
62 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true);
75 CharBuffer outBuffer = decoder.decode(ByteBuffer.wrap(arr, offset, arr.length - offset));
99 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0xe2 }), cb, false);
101 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x98 }), cb, false);
103 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x83 }), cb, false);
105 cr = decoder.decode(ByteBuffer.wrap(new byte[0]), cb, true);
118 CoderResult cr = decoder.decode(
/libcore/luni/src/test/java/libcore/java/net/
H A DUrlEncodingTest.java35 * URLDecoder and URI disagree on what '+' should decode to.
38 assertEquals("a b", URLDecoder.decode("a+b"));
39 assertEquals("a b", URLDecoder.decode("a+b", "UTF-8"));
50 assertEquals("a b", URLDecoder.decode("a b"));
51 assertEquals("a b", URLDecoder.decode("a b", "UTF-8"));
80 URLDecoder.decode("%");
85 URLDecoder.decode("%0");
101 URLDecoder.decode("%0g");
109 URLDecoder.decode("ab", null);
118 URLDecoder.decode("a
[all...]
/libcore/ojluni/src/main/java/java/security/
H A DCertificate.java43 * decode certificates) and some types of information, such as a
99 * be decoded by the {@code decode} method.
110 * @see #decode
133 public abstract void decode(InputStream stream) method in interface:Certificate
141 * and {@code decode} methods.
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
H A DCharsetDecoderTest.java199 * Class under test for CharBuffer decode(ByteBuffer)
208 decoder.decode(null);
214 CharBuffer out = decoder.decode(ByteBuffer.allocate(0));
219 out = decoder.decode(in);
227 out = decoder.decode(in);
246 CharBuffer buffer = decoder.decode(in);
255 out = decoder.decode(in);
261 out = decoder.decode(in);
271 decoder.decode(in);
279 out = decoder.decode(i
[all...]
H A DCharsetDecoder2Test.java67 * @tests java.nio.charset.CharsetDecoder#decode(java.nio.ByteBuffer)
76 // decoder.decode(bb);
81 // CharBuffer charbuf = Charset.forName("UTF-16").decode(buf);
84 // charbuf = Charset.forName("UTF-16BE").decode(buf);
87 // charbuf = Charset.forName("UTF-16LE").decode(buf);
96 decoder2.decode(in);
104 * Test malfunction decode(ByteBuffer)
111 .onUnmappableCharacter(CodingErrorAction.REPLACE).decode(
121 cs2.decode(ByteBuffer.wrap(new byte[] { 0x00, 0x11 }));
122 fail("Assert 1: Charset.decode shoul
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
H A DByteTest.java277 * java.lang.Byte#decode(String)
280 assertEquals(new Byte((byte) 0), Byte.decode("0"));
281 assertEquals(new Byte((byte) 1), Byte.decode("1"));
282 assertEquals(new Byte((byte) -1), Byte.decode("-1"));
283 assertEquals(new Byte((byte) 0xF), Byte.decode("0xF"));
284 assertEquals(new Byte((byte) 0xF), Byte.decode("#F"));
285 assertEquals(new Byte((byte) 0xF), Byte.decode("0XF"));
286 assertEquals(new Byte((byte) 07), Byte.decode("07"));
289 Byte.decode("9.2");
295 Byte.decode("");
[all...]
H A DShortTest.java62 * java.lang.Short#decode(java.lang.String)
66 // java.lang.Short.decode(java.lang.String)
67 assertTrue("Did not decode -1 correctly", Short.decode("-1")
69 assertTrue("Did not decode -100 correctly", Short.decode("-100")
71 assertTrue("Did not decode 23 correctly", Short.decode("23")
73 assertTrue("Did not decode 0x10 correctly", Short.decode("
[all...]
H A DIntegerTest.java67 * java.lang.Integer#decode(java.lang.String)
71 // java.lang.Integer.decode(java.lang.String)
73 132233, Integer.decode("132233").intValue());
75 07654321, Integer.decode("07654321").intValue());
77 Integer.decode("#1234567").intValue() == 0x1234567);
79 Integer.decode("0xdAd").intValue() == 0xdad);
80 assertEquals("Failed for -23", -23, Integer.decode("-23").intValue());
82 .decode("0").intValue());
83 assertEquals("Returned incorrect value for 0 hex", 0, Integer.decode("0x0")
86 Integer.decode("
[all...]
H A DLongTest.java67 * java.lang.Long#decode(java.lang.String)
71 // java.lang.Long.decode(java.lang.String)
72 assertEquals("Returned incorrect value for hex string", 255L, Long.decode(
74 assertEquals("Returned incorrect value for dec string", -89000L, Long.decode(
76 assertEquals("Returned incorrect value for 0 decimal", 0, Long.decode("0")
78 assertEquals("Returned incorrect value for 0 hex", 0, Long.decode("0x0")
82 Long.decode("-9223372036854775808").longValue() == 0x8000000000000000L);
85 Long.decode("-0x8000000000000000").longValue() == 0x8000000000000000L);
88 Long.decode("9223372036854775807").longValue() == 0x7fffffffffffffffL);
91 Long.decode("
[all...]
/libcore/luni/src/test/java/libcore/java/lang/
H A DIntegerTest.java81 assertEquals(0, Integer.decode("+0").intValue());
82 assertEquals(473, Integer.decode("+473").intValue());
83 assertEquals(255, Integer.decode("+0xFF").intValue());
84 assertEquals(16, Integer.decode("+020").intValue());
85 assertEquals(2147483647, Integer.decode("+2147483647").intValue());
86 assertEquals(-73, Integer.decode("-73").intValue());
87 assertEquals(-255, Integer.decode("-0xFF").intValue());
88 assertEquals(255, Integer.decode("+#FF").intValue());
89 assertEquals(-255, Integer.decode("-#FF").intValue());
92 Integer.decode("
[all...]
H A DLongTest.java111 assertEquals(0, Long.decode("+0").longValue());
112 assertEquals(473, Long.decode("+473").longValue());
113 assertEquals(255, Long.decode("+0xFF").longValue());
114 assertEquals(16, Long.decode("+020").longValue());
115 assertEquals(Long.MAX_VALUE, Long.decode("+" + Long.MAX_VALUE).longValue());
116 assertEquals(-73, Long.decode("-73").longValue());
117 assertEquals(-255, Long.decode("-0xFF").longValue());
118 assertEquals(255, Long.decode("+#FF").longValue());
119 assertEquals(-255, Long.decode("-#FF").longValue());
122 Long.decode("
[all...]
/libcore/luni/src/test/java/libcore/libcore/net/
H A DUriCodecTest.java253 assertEquals("", UriCodec.decode(""));
259 UriCodec.decode("ab%2f$%C4%82%25%e0%a1%80%p");
269 UriCodec.decode("ab%2f$%c4%82%25%e0%a1%80%1p");
279 UriCodec.decode("ab%2f$%c4%82%25%e0%a1%80%");
288 UriCodec.decode("ab%2f$%c4%82%25%e0%a1%80%",
296 UriCodec.decode("ab%2f$%c4%82%25+%e0%a1%80",
302 // Last character needs decoding (make sure we are flushing the buffer with chars to decode).
305 UriCodec.decode("ab%2f$%c4%82%25%e0%a1%80"));
312 UriCodec.decode("ab%2f$%c4%82%25%e0%a1%80aa%e0%a1%80"));
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/
H A DURLEncoderTest.java38 assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode(
40 assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode(
42 assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode(
/libcore/ojluni/src/main/java/java/net/
H A DURLDecoder.java64 * The encoding scheme used to decode these characters may be specified,
89 * @param s the {@code String} to decode
91 * default encoding. Instead, use the decode(String,String) method
96 public static String decode(String s) { method in class:URLDecoder
101 str = decode(s, dfltEncName);
122 * @param s the {@code String} to decode
133 public static String decode(String s, String enc) method in class:URLDecoder
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DOutputStreamTesterTest.java152 public byte[] decode(byte[] delegateBytes) throws Exception { method in class:OutputStreamTesterTest.FilterOutputStreamTester
168 public byte[] decode(byte[] delegateBytes) throws Exception { method in class:OutputStreamTesterTest.BufferedOutputStreamTester
179 public byte[] decode(byte[] delegateBytes) throws Exception { method in class:OutputStreamTesterTest.DataOutputStreamTester
190 public byte[] decode(byte[] delegateBytes) throws Exception { method in class:OutputStreamTesterTest.ObjectOutputStreamTester
202 public byte[] decode(byte[] delegateBytes) throws Exception { method in class:OutputStreamTesterTest.PrintStreamTester
/libcore/ojluni/src/main/java/java/util/
H A DUUID.java198 long mostSigBits = Long.decode(components[0]).longValue();
200 mostSigBits |= Long.decode(components[1]).longValue();
202 mostSigBits |= Long.decode(components[2]).longValue();
204 long leastSigBits = Long.decode(components[3]).longValue();
206 leastSigBits |= Long.decode(components[4]).longValue();
/libcore/luni/src/test/java/libcore/java/util/
H A DBase64Test.java309 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 0, decoder.decode(""));
310 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 1, decoder.decode("/w=="));
311 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 2, decoder.decode("/+4="));
312 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 3, decoder.decode("/+7d"));
313 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 4, decoder.decode("/+7dzA=="));
314 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 5, decoder.decode("/+7dzLs="));
315 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 6, decoder.decode("/+7dzLuq"));
316 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 7, decoder.decode("/+7dzLuqmQ=="));
317 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 8, decoder.decode("/+7dzLuqmYg="));
326 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 0, decoder.decode(""));
[all...]
/libcore/luni/src/test/java/libcore/javax/crypto/spec/
H A DAlgorithmParametersTestOAEP.java136 params.init(Base64.getDecoder().decode(ENCODED_DATA_ALL_DEFAULTS));
149 params.init(Base64.getDecoder().decode(ENCODED_DATA_EXPLICIT_DEFAULTS));
162 params.init(Base64.getDecoder().decode(ENCODED_DATA_NON_DEFAULTS));
175 params.init(Base64.getDecoder().decode(ENCODED_DATA_MIXED));
/libcore/ojluni/src/main/java/sun/misc/
H A DFileURLMapper.java64 path = ParseUtil.decode (path);

Completed in 2751 milliseconds

1234