Home
last modified time | relevance | path

Searched refs:encode (Results 1 – 25 of 91) sorted by relevance

1234

/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/
DURLEncoderTest.java39 URLEncoder.encode(URL)).equals(URL)); in test_encodeLjava_lang_String()
41 URLEncoder.encode(URL2)).equals(URL2)); in test_encodeLjava_lang_String()
43 URLEncoder.encode(URL3)).equals(URL3)); in test_encodeLjava_lang_String()
53 URLEncoder.encode("str", "unknown_enc"); in test_encodeLjava_lang_StringLjava_lang_String()
62 URLEncoder.encode(null, "harmony"); in test_encodeLjava_lang_StringLjava_lang_String()
71 assertEquals("%82%A0", URLEncoder.encode("あ", "Shift_JIS")); in test11571917()
72 assertEquals("%82%A9", URLEncoder.encode("か", "Shift_JIS")); in test11571917()
73 assertEquals("%97%43", URLEncoder.encode("佑", "Shift_JIS")); in test11571917()
74 assertEquals("%24", URLEncoder.encode("$", "Shift_JIS")); in test11571917()
75 assertEquals("%E3%81%8B", URLEncoder.encode("か", "UTF-8")); in test11571917()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DASCIICharsetEncoderTest.java80 encoder.encode(CharBuffer.wrap("\ud800\udc00")); in testMultiStepEncode()
87 encoder.encode(CharBuffer.wrap("\ud800"), out, true)); in testMultiStepEncode()
94 assertSame(CoderResult.UNDERFLOW, encoder.encode(buffer1, out, false)); in testMultiStepEncode()
99 assertTrue(encoder.encode(buffer2, out, true).isUnmappable()); in testMultiStepEncode()
109 ByteBuffer bb = encoder.encode(cb); in testEncodeMapping()
115 encoder.encode(cb); in testEncodeMapping()
122 encoder.encode(cb); in testEncodeMapping()
130 encoder.encode(cb, bb, false); in testEncodeMapping()
132 encoder.encode(cb); in testEncodeMapping()
144 encoder.encode(in, out, false); in testInternalState()
[all …]
DCharsetEncoderTest.java273 encoder.encode(CharBuffer.wrap("aaa")); in testResetIllegalState()
275 encoder.encode(CharBuffer.wrap("aaa"), ByteBuffer.allocate(3), false); in testResetIllegalState()
277 encoder.encode(CharBuffer.wrap("aaa"), ByteBuffer.allocate(3), true); in testResetIllegalState()
295 encoder.encode(in, out, true); in testFlushIllegalState()
304 encoder.encode(in, out, false); in testFlushIllegalState()
330 encoder.encode(in); in testEncodeFacadeIllegalState()
334 encoder.encode(in); in testEncodeFacadeIllegalState()
340 encoder.encode(in); in testEncodeFacadeIllegalState()
344 encoder.encode(in); in testEncodeFacadeIllegalState()
349 encoder.encode(CharBuffer.wrap("testCanEncodeIllegalState2"), in testEncodeFacadeIllegalState()
[all …]
DAbstractCharsetTestCase.java117 this.testingCharset.encode((String) null); in testEncode_String_Null()
129 this.testingCharset.encode((CharBuffer) null); in testEncode_CharBuffer_Null()
140 ByteBuffer bb = this.testingCharset.encode(input); in internalTestEncode()
DCharsetEncoder2Test.java111 cs.encode(CharBuffer.wrap("AB")); in test_EncodeLjava_nio_CharBuffer()
166 CoderResult result = encoder.encode(char1, bytes, false); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
171 result = encoder.encode(char2, bytes, true); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
203 Charset.forName("UTF-8").encode(CharBuffer.wrap(s)); in testUtf8Encoding()
DCharsetTest.java280 ByteBuffer out = cs.encode(s); in assertEncodes()
654 ByteBuffer bb = c1.encode(CharBuffer.wrap("abcdefg"));
656 bb = c1.encode(CharBuffer.wrap(""));
662 ByteBuffer bb = c1.encode(CharBuffer.wrap("abcd\u5D14efg"));
670 c.encode((CharBuffer) null);
679 c.encode(CharBuffer.wrap("hehe"));
687 ByteBuffer bb = c1.encode("abcdefg");
689 bb = c1.encode("");
695 ByteBuffer bb = c1.encode("abcd\u5D14efg");
703 c.encode((String) null);
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DUrlEncodingTest.java44 assertEquals("a%2Bb", URLEncoder.encode("a+b")); in testEncodingPlus()
45 assertEquals("a%2Bb", URLEncoder.encode("a+b", "UTF-8")); in testEncodingPlus()
60 assertEquals("a+b", URLEncoder.encode("a b")); in testEncodingSpace()
61 assertEquals("a+b", URLEncoder.encode("a b", "UTF-8")); in testEncodingSpace()
127 URLEncoder.encode("ab", null); in testUrlEncoderFailsOnNullCharset()
136 URLEncoder.encode("ab", ""); in testUrlEncoderFailsOnEmptyCharset()
157 URLEncoder.encode("ab", "no-such-charset"); in testUrlEncoderFailsOnInvalidCharset()
208 assertEquals("%00", URLEncoder.encode("\u0000", "UTF-8")); in testUrlEncoderEncodesNonPrintableNonAsciiCharacters()
209 assertEquals("%00", URLEncoder.encode("\u0000")); in testUrlEncoderEncodesNonPrintableNonAsciiCharacters()
210 assertEquals("%E2%82%AC", URLEncoder.encode("\u20AC", "UTF-8")); in testUrlEncoderEncodesNonPrintableNonAsciiCharacters()
[all …]
/libcore/luni/src/main/java/java/net/
DURLEncoder.java49 public static String encode(String s) { in encode() method in URLEncoder
50 return ENCODER.encode(s, StandardCharsets.UTF_8); in encode()
56 public static String encode(String s, String charsetName) throws UnsupportedEncodingException { in encode() method in URLEncoder
57 return ENCODER.encode(s, Charset.forName(charsetName)); in encode()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetEncoderTest.java36 String output = ascii.decode(e.encode(CharBuffer.wrap(input))).toString(); in test_replaceWith()
70 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842', '\udf9f' }), bb, false); in testSurrogatePairAllAtOnce()
84 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false); in testMalformedSurrogatePair()
121 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842' }), bb, false); in testCharsetEncoderSplitSurrogates()
124 cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false); in testCharsetEncoderSplitSurrogates()
133 cr = e.encode(CharBuffer.wrap(new char[] { }), bb, true); in testCharsetEncoderSplitSurrogates()
145 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, false); in testFlushWithoutEndOfInput()
157 cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, true); in testFlushWithoutEndOfInput()
DOldCharsetEncoderDecoderBufferTest.java102 encoder.encode(CharBuffer.wrap("ab"), out, false); in testEncoderOutputBuffer()
114 encoder.encode(CharBuffer.wrap("x"), out, true); in testEncoderOutputBuffer()
134 encoder.encode(inWithArray, out, false); in testEncoderInputBuffer()
141 encoder.encode(inWithoutArray, out, true); in testEncoderInputBuffer()
DCharsetDecoderTest.java42 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_no_offset()
56 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_with_offset()
72 byte[] arr = encode("UTF-16", "Android"); in test_ByteArray_decode_with_offset_using_facade_method()
86 private static byte[] encode(String charsetName, String s) throws Exception { in encode() method in CharsetDecoderTest
88 return encoder.encode(CharBuffer.wrap(s)).array(); in encode()
DOldCharset_AbstractTest.java112 outputBB = encoder.encode(inputCB); in test_dumpEncoded()
139 outputBB = encoder.encode(inputCB); in test_Encode()
157 ByteBuffer intermediateBB = encoder.encode(inputCB); in NNtest_CodecDynamicIndividuals()
191 ByteBuffer intermediateBB = encoder.encode(inputCB); in test_CodecDynamic()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/
DURLDecoderTest.java45 URLEncoder.encode(URL)).equals(URL)); in test_decodeLjava_lang_String()
47 URLEncoder.encode(URL2)).equals(URL2)); in test_decodeLjava_lang_String()
49 URLEncoder.encode(URL3)).equals(URL3)); in test_decodeLjava_lang_String()
/libcore/dex/src/main/java/com/android/dex/
DMutf8.java89 public static void encode(byte[] dst, int offset, String s) { in encode() method in Mutf8
109 public static byte[] encode(String s) throws UTFDataFormatException { in encode() method in Mutf8
112 encode(result, 0, s); in encode()
/libcore/luni/src/main/java/java/nio/charset/
DModifiedUtf8.java96 public static void encode(byte[] dst, int offset, String s) { in encode() method in ModifiedUtf8
118 public static byte[] encode(String s) throws UTFDataFormatException { in encode() method in ModifiedUtf8
122 ModifiedUtf8.encode(result, SizeOf.SHORT, s); in encode()
DCharset.java440 public final ByteBuffer encode(CharBuffer buffer) { in encode() method in Charset
444 .onUnmappableCharacter(CodingErrorAction.REPLACE).encode( in encode()
461 public final ByteBuffer encode(String s) { in encode() method in Charset
462 return encode(CharBuffer.wrap(s)); in encode()
DCharsetEncoder.java202 encode(cb); in canEncode()
251 public final ByteBuffer encode(CharBuffer in) throws CharacterCodingException { in encode() method in CharsetEncoder
258 CoderResult result = encode(in, out, true); in encode()
358 public final CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput) { in encode() method in CharsetEncoder
/libcore/luni/src/main/java/org/apache/harmony/security/pkcs7/
DContentInfo.java80 encoding = ASN1.encode(this); in getEncoded()
122 ASN1OctetString.getInstance().encode(ci.content);
125 values[1] = SignedData.ASN1.encode(ci.content);
/libcore/luni/src/main/java/java/security/cert/
DExtension.java64 void encode(OutputStream out) throws IOException; in encode() method
/libcore/luni/src/main/java/java/security/
DCertificate.java65 public void encode(OutputStream stream) throws KeyException, IOException; in encode() method
/libcore/luni/src/main/java/org/apache/harmony/security/x509/
DAlternativeName.java57 encoding = GeneralNames.ASN1.encode(alternativeNames); in getEncoded()
DInhibitAnyPolicy.java56 .encode(ASN1Integer.fromIntValue(skipCerts)); in getEncoded()
DORAddress.java58 encoding = ASN1.encode(this); in getEncoded()
DCRLNumber.java60 encoding = ASN1.encode(number.toByteArray()); in getEncoded()
/libcore/luni/src/test/java/libcore/io/
DBase64Test.java52 assertEquals(expected, Base64.encode(dataBytes)); in assertEncoded()

1234