/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
D | CharsetDecoderTest.java | 208 decoder.decode(null); in implTestDecodeByteBuffer() 214 CharBuffer out = decoder.decode(ByteBuffer.allocate(0)); in implTestDecodeByteBuffer() 219 out = decoder.decode(in); in implTestDecodeByteBuffer() 227 out = decoder.decode(in); in implTestDecodeByteBuffer() 246 CharBuffer buffer = decoder.decode(in); in testDecodeByteBufferException() 255 out = decoder.decode(in); in testDecodeByteBufferException() 261 out = decoder.decode(in); in testDecodeByteBufferException() 271 decoder.decode(in); in testDecodeByteBufferException() 279 out = decoder.decode(in); in testDecodeByteBufferException() 285 out = decoder.decode(in); in testDecodeByteBufferException() [all …]
|
D | CharsetDecoder2Test.java | 96 decoder2.decode(in); in test_decode() 111 .onUnmappableCharacter(CodingErrorAction.REPLACE).decode( in test_decodeLjava_nio_ByteBuffer() 121 cs2.decode(ByteBuffer.wrap(new byte[] { 0x00, 0x11 })); in test_decodeLjava_nio_ByteBuffer() 192 CoderResult result = decoder.decode(in, out, false); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow() 199 result = decoder.decode(in, out, true); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow() 259 CharBuffer cb = decoder.decode(ByteBuffer.wrap(bytes)); in testInvalidDecoding() 272 CharBuffer cb = decoder.decode(bb); in testInvalidDecoding()
|
/libcore/luni/src/test/java/libcore/java/net/ |
D | UrlEncodingTest.java | 38 assertEquals("a b", URLDecoder.decode("a+b")); in testDecodingPlus() 39 assertEquals("a b", URLDecoder.decode("a+b", "UTF-8")); in testDecodingPlus() 50 assertEquals("a b", URLDecoder.decode("a b")); in testDecodingSpace() 51 assertEquals("a b", URLDecoder.decode("a b", "UTF-8")); in testDecodingSpace() 80 URLDecoder.decode("%"); in testUrlDecoderDecodingPartial() 85 URLDecoder.decode("%0"); in testUrlDecoderDecodingPartial() 101 URLDecoder.decode("%0g"); in testUrlDecoderDecodingInvalid() 109 URLDecoder.decode("ab", null); in testUrlDecoderFailsOnNullCharset() 118 URLDecoder.decode("ab", ""); in testUrlDecoderFailsOnEmptyCharset() 149 assertEquals("ab", URLDecoder.decode("ab", "no-such-charset")); in testUrlDecoderIgnoresUnnecessaryCharset() [all …]
|
/libcore/luni/src/test/java/libcore/libcore/util/ |
D | HexEncodingTest.java | 24 import static libcore.util.HexEncoding.decode; 69 assertArraysEqual(bytes, decode(encode(bytes), false /* allowSingleChar */)); in testEncodeBytes() 72 assertArraysEqual(bytes, decode(encodedLower.toCharArray(), false /* allowSingleChar */)); in testEncodeBytes() 77 assertArraysEqual(new byte[] { 6 }, decode("6".toCharArray(), true)); in testDecode_allow4Bit() 78 assertArraysEqual(new byte[] { 6, 0x76 }, decode("676".toCharArray(), true)); in testDecode_allow4Bit() 83 decode("676".toCharArray(), false /* allowSingleChar */); in testDecode_disallow4Bit() 91 decode("DEADBARD".toCharArray(), false /* allowSingleChar */); in testDecode_invalid() 100 decode("६१٧٥٥F6361646F73".toCharArray(), false /* allowSingleChar */); in testDecode_invalid() 106 decode("#%6361646F73".toCharArray(), false /* allowSingleChar */); in testDecode_invalid()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | ByteTest.java | 280 assertEquals(new Byte((byte) 0), Byte.decode("0")); in test_decodeLjava_lang_String() 281 assertEquals(new Byte((byte) 1), Byte.decode("1")); in test_decodeLjava_lang_String() 282 assertEquals(new Byte((byte) -1), Byte.decode("-1")); in test_decodeLjava_lang_String() 283 assertEquals(new Byte((byte) 0xF), Byte.decode("0xF")); in test_decodeLjava_lang_String() 284 assertEquals(new Byte((byte) 0xF), Byte.decode("#F")); in test_decodeLjava_lang_String() 285 assertEquals(new Byte((byte) 0xF), Byte.decode("0XF")); in test_decodeLjava_lang_String() 286 assertEquals(new Byte((byte) 07), Byte.decode("07")); in test_decodeLjava_lang_String() 289 Byte.decode("9.2"); in test_decodeLjava_lang_String() 295 Byte.decode(""); in test_decodeLjava_lang_String() 301 Byte.decode(null); in test_decodeLjava_lang_String() [all …]
|
D | ShortTest.java | 67 assertTrue("Did not decode -1 correctly", Short.decode("-1") in test_decodeLjava_lang_String2() 69 assertTrue("Did not decode -100 correctly", Short.decode("-100") in test_decodeLjava_lang_String2() 71 assertTrue("Did not decode 23 correctly", Short.decode("23") in test_decodeLjava_lang_String2() 73 assertTrue("Did not decode 0x10 correctly", Short.decode("0x10") in test_decodeLjava_lang_String2() 75 assertTrue("Did not decode 32767 correctly", Short.decode("32767") in test_decodeLjava_lang_String2() 77 assertTrue("Did not decode -32767 correctly", Short.decode("-32767") in test_decodeLjava_lang_String2() 79 assertTrue("Did not decode -32768 correctly", Short.decode("-32768") in test_decodeLjava_lang_String2() 84 Short.decode("123s"); in test_decodeLjava_lang_String2() 94 Short.decode("32768"); in test_decodeLjava_lang_String2() 103 Short.decode("-32769"); in test_decodeLjava_lang_String2() [all …]
|
D | IntegerTest.java | 73 132233, Integer.decode("132233").intValue()); in test_decodeLjava_lang_String2() 75 07654321, Integer.decode("07654321").intValue()); in test_decodeLjava_lang_String2() 77 Integer.decode("#1234567").intValue() == 0x1234567); in test_decodeLjava_lang_String2() 79 Integer.decode("0xdAd").intValue() == 0xdad); in test_decodeLjava_lang_String2() 80 assertEquals("Failed for -23", -23, Integer.decode("-23").intValue()); in test_decodeLjava_lang_String2() 82 .decode("0").intValue()); in test_decodeLjava_lang_String2() 83 assertEquals("Returned incorrect value for 0 hex", 0, Integer.decode("0x0") in test_decodeLjava_lang_String2() 86 Integer.decode("-2147483648").intValue() == 0x80000000); in test_decodeLjava_lang_String2() 88 Integer.decode("-0x80000000").intValue() == 0x80000000); in test_decodeLjava_lang_String2() 90 Integer.decode("2147483647").intValue() == 0x7fffffff); in test_decodeLjava_lang_String2() [all …]
|
D | LongTest.java | 72 assertEquals("Returned incorrect value for hex string", 255L, Long.decode( in test_decodeLjava_lang_String2() 74 assertEquals("Returned incorrect value for dec string", -89000L, Long.decode( in test_decodeLjava_lang_String2() 76 assertEquals("Returned incorrect value for 0 decimal", 0, Long.decode("0") in test_decodeLjava_lang_String2() 78 assertEquals("Returned incorrect value for 0 hex", 0, Long.decode("0x0") in test_decodeLjava_lang_String2() 82 Long.decode("-9223372036854775808").longValue() == 0x8000000000000000L); in test_decodeLjava_lang_String2() 85 Long.decode("-0x8000000000000000").longValue() == 0x8000000000000000L); in test_decodeLjava_lang_String2() 88 Long.decode("9223372036854775807").longValue() == 0x7fffffffffffffffL); in test_decodeLjava_lang_String2() 91 Long.decode("0x7fffffffffffffff").longValue() == 0x7fffffffffffffffL); in test_decodeLjava_lang_String2() 92 assertTrue("Failed for 07654321765432", Long.decode("07654321765432") in test_decodeLjava_lang_String2() 98 .decode("999999999999999999999999999999999999999999999999999999"); in test_decodeLjava_lang_String2() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | IntegerTest.java | 81 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("--1"); // multiple sign chars [all …]
|
D | LongTest.java | 111 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("--1"); // multiple sign chars [all …]
|
/libcore/luni/src/main/java/libcore/util/ |
D | HexEncoding.java | 112 public static byte[] decode(String encoded) throws IllegalArgumentException { in decode() method in HexEncoding 113 return decode(encoded.toCharArray()); in decode() 124 public static byte[] decode(String encoded, boolean allowSingleChar) in decode() method in HexEncoding 126 return decode(encoded.toCharArray(), allowSingleChar); in decode() 136 public static byte[] decode(char[] encoded) throws IllegalArgumentException { in decode() method in HexEncoding 137 return decode(encoded, false); in decode() 148 public static byte[] decode(char[] encoded, boolean allowSingleChar) in decode() method in HexEncoding
|
/libcore/luni/src/test/java/libcore/java/nio/charset/ |
D | CharsetDecoderTest.java | 36 assertEquals("\u6d61x", d.decode(in).toString()); in test_replaceWith() 46 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true); in test_ByteArray_decode_no_offset() 62 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true); in test_ByteArray_decode_with_offset() 75 CharBuffer outBuffer = decoder.decode(ByteBuffer.wrap(arr, offset, arr.length - offset)); in test_ByteArray_decode_with_offset_using_facade_method() 99 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0xe2 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites() 101 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x98 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites() 103 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x83 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites() 105 cr = decoder.decode(ByteBuffer.wrap(new byte[0]), cb, true); in testUtf8BytesSplitAcrossMultipleWrites() 118 CoderResult cr = decoder.decode( in testBufferWithNonZeroOffset()
|
D | OldCharsetEncoderDecoderBufferTest.java | 43 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'a', (byte)'b', (byte)'c', (byte)'d'}), in testDecoderOutputBuffer() 53 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'x'}), out, true); in testDecoderOutputBuffer() 76 decoder.decode(inWithArray, out, false); in testDecoderInputBuffer() 83 decoder.decode(inWithoutArray, out, true); in testDecoderInputBuffer()
|
D | OldCharset_AbstractTest.java | 128 static void decode (byte[] input, char[] expectedOutput) throws CharacterCodingException { in decode() method in OldCharset_AbstractTest 131 CharBuffer outputCB = decoder.decode(inputBB); in decode() 137 decode(testBytes, testChars); in test_Decode() 166 CharBuffer outputCB = decoder.decode(intermediateBB); in NNtest_CodecDynamicIndividuals() 208 CharBuffer outputCB = decoder.decode(intermediateBB); in test_CodecDynamic()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/ |
D | URLDecoderTest.java | 44 assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode( in test_decodeLjava_lang_String() 46 assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode( in test_decodeLjava_lang_String() 48 assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode( in test_decodeLjava_lang_String() 58 URLDecoder.decode("", ""); in test_decodeLjava_lang_String_Ljava_lang_String()
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | Base64Test.java | 309 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 0, decoder.decode("")); in checkDecoder_nonPrintableBytes_table1() 310 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 1, decoder.decode("/w==")); in checkDecoder_nonPrintableBytes_table1() 311 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 2, decoder.decode("/+4=")); in checkDecoder_nonPrintableBytes_table1() 312 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 3, decoder.decode("/+7d")); in checkDecoder_nonPrintableBytes_table1() 313 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 4, decoder.decode("/+7dzA==")); in checkDecoder_nonPrintableBytes_table1() 314 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 5, decoder.decode("/+7dzLs=")); in checkDecoder_nonPrintableBytes_table1() 315 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 6, decoder.decode("/+7dzLuq")); in checkDecoder_nonPrintableBytes_table1() 316 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 7, decoder.decode("/+7dzLuqmQ==")); in checkDecoder_nonPrintableBytes_table1() 317 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 8, decoder.decode("/+7dzLuqmYg=")); in checkDecoder_nonPrintableBytes_table1() 326 assertArrayPrefixEquals(SAMPLE_NON_ASCII_BYTES, 0, decoder.decode("")); in testDecoder_nonPrintableBytes_url() [all …]
|
D | LibcoreIoDerivedBase64Test.java | 78 byte[] decoded = decode(new byte[0]); in testDecode_empty() 215 byte[] out = decode(bytes); in decodeToString() 228 CharBuffer charsBuffer = decoder.decode(bytesBuffer); in bytesToAscii() 260 byte[] bytes = decode(asciiToBytes(in)); in decodeToInts() 264 private static byte[] decode(byte[] encoded) { in decode() method in LibcoreIoDerivedBase64Test 267 return decoder.decode(encoded); in decode()
|
/libcore/ojluni/src/main/java/java/util/ |
D | UUID.java | 198 long mostSigBits = Long.decode(components[0]).longValue(); in fromString() 200 mostSigBits |= Long.decode(components[1]).longValue(); in fromString() 202 mostSigBits |= Long.decode(components[2]).longValue(); in fromString() 204 long leastSigBits = Long.decode(components[3]).longValue(); in fromString() 206 leastSigBits |= Long.decode(components[4]).longValue(); in fromString()
|
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ |
D | URLEncoderTest.java | 38 assertTrue("1. Incorrect encoding/decoding", URLDecoder.decode( in test_encodeLjava_lang_String() 40 assertTrue("2. Incorrect encoding/decoding", URLDecoder.decode( in test_encodeLjava_lang_String() 42 assertTrue("3. Incorrect encoding/decoding", URLDecoder.decode( in test_encodeLjava_lang_String()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ |
D | OutputStreamTesterTest.java | 152 public byte[] decode(byte[] delegateBytes) throws Exception { in decode() method in OutputStreamTesterTest.FilterOutputStreamTester 168 public byte[] decode(byte[] delegateBytes) throws Exception { in decode() method in OutputStreamTesterTest.BufferedOutputStreamTester 179 public byte[] decode(byte[] delegateBytes) throws Exception { in decode() method in OutputStreamTesterTest.DataOutputStreamTester 190 public byte[] decode(byte[] delegateBytes) throws Exception { in decode() method in OutputStreamTesterTest.ObjectOutputStreamTester 202 public byte[] decode(byte[] delegateBytes) throws Exception { in decode() method in OutputStreamTesterTest.PrintStreamTester
|
/libcore/ojluni/src/main/java/java/net/ |
D | URLDecoder.java | 96 public static String decode(String s) { in decode() method in URLDecoder 101 str = decode(s, dfltEncName); in decode() 133 public static String decode(String s, String enc) in decode() method in URLDecoder
|
/libcore/ojluni/src/main/java/sun/net/www/protocol/ftp/ |
D | FtpURLConnection.java | 197 user = ParseUtil.decode(userInfo); in FtpURLConnection() 200 user = ParseUtil.decode(userInfo.substring(0, delimiter++)); in FtpURLConnection() 201 password = ParseUtil.decode(userInfo.substring(delimiter)); in FtpURLConnection() 374 filename = ParseUtil.decode(filename); in decodePath() 377 filename = ParseUtil.decode(path); in decodePath() 402 ftp.changeDirectory(ParseUtil.decode(path)); in cd() 408 ftp.changeDirectory(ParseUtil.decode(token.nextToken())); in cd()
|
/libcore/luni/src/test/java/libcore/java/security/spec/ |
D | AlgorithmParametersPSSTest.java | 40 private static final byte[] DEFAULT_SPEC_DER_ENCODED = HexEncoding.decode("3000"); 45 HexEncoding.decode( 51 HexEncoding.decode( 57 HexEncoding.decode(
|
/libcore/ojluni/src/main/java/sun/security/x509/ |
D | X509Key.java | 379 public void decode(InputStream in) in decode() method in X509Key 402 public void decode(byte[] encodedKey) throws InvalidKeyException { in decode() method in X509Key 403 decode(new ByteArrayInputStream(encodedKey)); in decode() 420 decode(stream); in readObject()
|
/libcore/ojluni/src/main/java/sun/security/pkcs/ |
D | PKCS8Key.java | 323 public void decode(InputStream in) throws InvalidKeyException in decode() method in PKCS8Key 355 public void decode(byte[] encodedKey) throws InvalidKeyException { in decode() method in PKCS8Key 356 decode(new ByteArrayInputStream(encodedKey)); in decode() 374 decode(stream); in readObject()
|