/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
D | CharsetEncoderTest.java | 51 CharsetEncoder encoder; field in CharsetEncoderTest 69 encoder = cs.newEncoder(); in setUp() 71 byte[] replacement = encoder.replacement(); in setUp() 88 assertTrue(encoder.averageBytesPerChar() == AVER_BYTES); in testSpecificDefaultValue() 89 assertTrue(encoder.maxBytesPerChar() == MAX_BYTES); in testSpecificDefaultValue() 93 assertEquals(CodingErrorAction.REPORT, encoder.malformedInputAction()); in testDefaultValue() 94 assertEquals(CodingErrorAction.REPORT, encoder.unmappableCharacterAction()); in testDefaultValue() 95 assertSame(encoder, encoder.onMalformedInput(CodingErrorAction.IGNORE)); in testDefaultValue() 96 assertSame(encoder, encoder.onUnmappableCharacter(CodingErrorAction.IGNORE)); in testDefaultValue() 97 if (encoder instanceof MockCharsetEncoder) { in testDefaultValue() [all …]
|
D | UTFCharsetEncoderTest.java | 49 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 50 assertTrue(encoder.canEncode('\uc2a3')); in testCanEncodechar() 53 assertTrue(encoder.canEncode('\uc2c0')); in testCanEncodechar() 58 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 59 assertTrue(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 62 assertTrue(encoder.canEncode("\uc2c0")); in testCanEncodeCharSequence() 68 assertTrue(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 70 assertFalse(encoder.canEncode("\ud800\udb00")); in testCanEncodeCharSequence() 74 assertEquals(2, encoder.averageBytesPerChar(), 0); in testSpecificDefaultValue() 75 assertEquals(3, encoder.maxBytesPerChar(), 0); in testSpecificDefaultValue()
|
D | UTF16LECharsetEncoderTest.java | 60 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 61 assertTrue(encoder.canEncode('\uc2a3')); in testCanEncodechar() 64 assertTrue(encoder.canEncode('\uc2c0')); in testCanEncodechar() 69 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 70 assertTrue(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 73 assertTrue(encoder.canEncode("\uc2c0")); in testCanEncodeCharSequence() 79 assertTrue(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 81 assertFalse(encoder.canEncode("\ud800\udb00")); in testCanEncodeCharSequence() 85 assertEquals(2, encoder.averageBytesPerChar(), 0.001); in testSpecificDefaultValue() 86 assertEquals(2, encoder.maxBytesPerChar(), 0.001); in testSpecificDefaultValue()
|
D | UTF16BECharsetEncoderTest.java | 59 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 60 assertTrue(encoder.canEncode('\uc2a3')); in testCanEncodechar() 63 assertTrue(encoder.canEncode('\uc2c0')); in testCanEncodechar() 69 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 70 assertTrue(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 73 assertTrue(encoder.canEncode("\uc2c0")); in testCanEncodeCharSequence() 79 assertTrue(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 81 assertFalse(encoder.canEncode("\ud800\udb00")); in testCanEncodeCharSequence() 85 assertEquals(2, encoder.averageBytesPerChar(), 0.001); in testSpecificDefaultValue() 86 assertEquals(2, encoder.maxBytesPerChar(), 0.001); in testSpecificDefaultValue()
|
D | ISOCharsetEncoderTest.java | 52 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 53 assertFalse(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 54 assertFalse(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 58 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 59 assertFalse(encoder.canEncode('\uc2a3')); in testCanEncodechar() 63 assertEquals(1, encoder.averageBytesPerChar(), 0.001); in testSpecificDefaultValue() 64 assertEquals(1, encoder.maxBytesPerChar(), 0.001); in testSpecificDefaultValue() 84 encoder.onMalformedInput(CodingErrorAction.REPORT); in testMultiStepEncode() 85 encoder.onUnmappableCharacter(CodingErrorAction.REPORT); in testMultiStepEncode() 87 encoder.encode(CharBuffer.wrap("\ud800\udc00")); in testMultiStepEncode() [all …]
|
D | UTF16CharsetEncoderTest.java | 63 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 64 assertTrue(encoder.canEncode('\uc2a3')); in testCanEncodechar() 67 assertTrue(encoder.canEncode('\uc2c0')); in testCanEncodechar() 72 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 73 assertTrue(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 76 assertTrue(encoder.canEncode("\uc2c0")); in testCanEncodeCharSequence() 82 assertTrue(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 84 assertFalse(encoder.canEncode("\ud800\udb00")); in testCanEncodeCharSequence() 88 assertEquals(encoder.averageBytesPerChar(), 2, 0.001); in testSpecificDefaultValue() 91 assertEquals(encoder.maxBytesPerChar(), 2, 0.001); in testSpecificDefaultValue()
|
D | ASCIICharsetEncoderTest.java | 34 private final CharsetEncoder encoder = cs.newEncoder(); field in ASCIICharsetEncoderTest 51 assertTrue(encoder.canEncode("\u0077")); in testCanEncodeCharSequence() 52 assertFalse(encoder.canEncode("\uc2a3")); in testCanEncodeCharSequence() 53 assertFalse(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 55 encoder.canEncode(null); in testCanEncodeCharSequence() 58 assertTrue(encoder.canEncode("")); in testCanEncodeCharSequence() 62 assertFalse(encoder.canEncode('\ud800')); in testCanEncodeSurrogate() 63 assertFalse(encoder.canEncode("\udc00")); in testCanEncodeSurrogate() 67 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 68 assertFalse(encoder.canEncode('\uc2a3')); in testCanEncodechar() [all …]
|
D | GBCharsetEncoderTest.java | 49 assertTrue(encoder.canEncode('\u0077')); in testCanEncodechar() 50 assertTrue(encoder.canEncode('\uc2a3')); in testCanEncodechar() 53 assertTrue(encoder.canEncode('\uc2c0')); in testCanEncodechar() 63 assertTrue(encoder.canEncode("\ud800\udc00")); in testCanEncodeCharSequence() 65 assertFalse(encoder.canEncode("\ud800\udb00")); in testCanEncodeCharSequence() 69 assertEquals(4.0, encoder.maxBytesPerChar(), 0.0); in testSpecificDefaultValue() 70 assertEquals(2.5, encoder.averageBytesPerChar(), 0.0); in testSpecificDefaultValue()
|
D | CharsetEncoder2Test.java | 159 CharsetEncoder encoder = utf8.newEncoder(); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB() local 163 encoder.reset(); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB() 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()
|
/libcore/ojluni/src/test/java/util/Base64/ |
D | Base64GetEncoderTest.java | 47 final Base64.Encoder encoder = Base64.getMimeEncoder(maxlen, "$$$".getBytes(US_ASCII)); in main() local 49 testEncodeToString(encoder); in main() 50 testWrapEncode1(encoder); in main() 51 testEncodeToStringWithLongInputData(encoder); in main() 52 testWrapEncode2(encoder); in main() 56 private static void testWrapEncode2(final Base64.Encoder encoder) in testWrapEncode2() argument 64 OutputStream base64EncodingStream = encoder.wrap(secondEncodingStream); in testWrapEncode2() 82 final Base64.Encoder encoder) { in testEncodeToStringWithLongInputData() argument 89 base64EncodedString = encoder.encodeToString(secondTestBuffer); in testEncodeToStringWithLongInputData() 100 private static void testWrapEncode1(final Base64.Encoder encoder) in testWrapEncode1() argument [all …]
|
D | TestBase64Golden.java | 71 public static void test0(Base64Type type, Encoder encoder, Decoder decoder, in test0() argument 112 int len = encoder.encode(srcArr, resArr); in test0() 117 resArr = encoder.encode(srcArr); in test0() 122 ByteBuffer resBuf = encoder.encode(srcBuf); in test0() 129 String resEncodeStr = encoder.encodeToString(srcArr); in test0() 162 Encoder encoder = Base64.getMimeEncoder(49, new byte[] { 0x7e }); in test1() local 163 byte[] encoded = encoder.encode(src); in test1()
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | Base64Test.java | 83 Encoder encoder) { in checkAlphabet() argument 91 byte[] encodedBytes = encoder.encode(bytes); in checkAlphabet() 519 private static void checkEncoder_nullArgs(Encoder encoder) { in checkEncoder_nullArgs() argument 520 assertThrowsNpe(() -> encoder.encode((byte[]) null)); in checkEncoder_nullArgs() 521 assertThrowsNpe(() -> encoder.encodeToString(null)); in checkEncoder_nullArgs() 522 assertThrowsNpe(() -> encoder.encode(null, null)); in checkEncoder_nullArgs() 523 assertThrowsNpe(() -> encoder.encode((ByteBuffer) null)); in checkEncoder_nullArgs() 524 assertThrowsNpe(() -> encoder.wrap(null)); in checkEncoder_nullArgs() 528 Encoder encoder = Base64.getUrlEncoder(); in testEncoder_nonPrintableBytes() local 529 assertEquals("", encoder.encodeToString(copyOfRange(SAMPLE_NON_ASCII_BYTES, 0, 0))); in testEncoder_nonPrintableBytes() [all …]
|
D | LibcoreIoDerivedBase64Test.java | 243 CharsetEncoder encoder = StandardCharsets.US_ASCII.newEncoder(); in asciiToBytes() local 244 encoder.onMalformedInput(CodingErrorAction.REPORT); in asciiToBytes() 245 encoder.onUnmappableCharacter(CodingErrorAction.REPORT); in asciiToBytes() 247 ByteBuffer bytesBuffer = encoder.encode(charsBuffer); in asciiToBytes()
|
/libcore/luni/src/test/java/libcore/java/nio/charset/ |
D | OldCharset_AbstractTest.java | 41 static CharsetEncoder encoder; field in OldCharset_AbstractTest 68 encoder = charset.newEncoder(); in setUp() 89 while (!encoder.canEncode((char) code)) code ++; in test_dumpEncodableChars() 96 while (!encoder.canEncode((char) code)) code ++; in test_dumpEncodableChars() 116 encoder.onUnmappableCharacter(CodingErrorAction.REPORT); in test_dumpEncoded() 117 outputBB = encoder.encode(inputCB); in test_dumpEncoded() 143 encoder.onUnmappableCharacter(CodingErrorAction.REPORT); in test_Encode() 144 outputBB = encoder.encode(inputCB); in test_Encode() 153 encoder.onUnmappableCharacter(CodingErrorAction.REPORT); in NNtest_CodecDynamicIndividuals() 157 if (encoder.canEncode((char) code)) { in NNtest_CodecDynamicIndividuals() [all …]
|
D | StandardCharsetsEncoderTest.java | 81 CharsetEncoder encoder = charset.newEncoder(); in testCharset() local 92 String actualInfo = createCodePointInfo(encoder, codePoint); in testCharset() 140 private static void dumpEncodings(CharsetEncoder encoder, String fileName) in dumpEncodings() argument 142 encoder.onMalformedInput(CodingErrorAction.IGNORE); in dumpEncodings() 143 encoder.onUnmappableCharacter(CodingErrorAction.IGNORE); in dumpEncodings() 146 writeLine(writer, "# Reference encodings for " + encoder.charset().name() in dumpEncodings() 152 String codePointInfo = createCodePointInfo(encoder, codePoint); in dumpEncodings() 164 private static String createCodePointInfo(CharsetEncoder encoder, int codePoint) { in createCodePointInfo() argument 171 stringBuilder.append(Boolean.toString(encoder.canEncode(utf16))); in createCodePointInfo() 178 encoder.encode(CHAR_BUFFER, BYTE_BUFFER, true /* endOfInput */); in createCodePointInfo() [all …]
|
D | OldCharsetEncoderDecoderBufferTest.java | 96 CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); in testEncoderOutputBuffer() local 102 encoder.encode(CharBuffer.wrap("ab"), out, false); in testEncoderOutputBuffer() 114 encoder.encode(CharBuffer.wrap("x"), out, true); in testEncoderOutputBuffer() 128 CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); in testEncoderInputBuffer() local 134 encoder.encode(inWithArray, out, false); in testEncoderInputBuffer() 141 encoder.encode(inWithoutArray, out, true); in testEncoderInputBuffer()
|
D | Charset_TestGenerator.java | 33 CharsetEncoder encoder; field in Charset_TestGenerator 220 CharsetEncoder encoder = charset.newEncoder(); in genEncoded() local 221 encoder.onUnmappableCharacter(CodingErrorAction.REPLACE); in genEncoded() 223 ByteBuffer bb = encoder.encode(cb); in genEncoded()
|
D | OldCharset_SingleByteAbstractTest.java | 107 encoder.onUnmappableCharacter(CodingErrorAction.REPLACE); in test_Encode() 108 outputBB = encoder.encode(inputCB); in test_Encode()
|
D | CharsetEncoderTest.java | 222 CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder(); 224 CoderResult result = encoder.encode(CharBuffer.wrap("\ud800"), output, 228 result = encoder.flush(output);
|
D | CharsetDecoderTest.java | 87 CharsetEncoder encoder = Charset.forName(charsetName).newEncoder(); in encode() local 88 ByteBuffer buf = encoder.encode(CharBuffer.wrap(s)); in encode()
|
/libcore/ojluni/src/main/java/sun/security/provider/certpath/ |
D | CertId.java | 105 HexDumpEncoder encoder = new HexDumpEncoder(); in CertId() local 108 encoder.encodeBuffer(issuerNameHash)); in CertId() 110 encoder.encodeBuffer(issuerKeyHash)); in CertId() 167 HexDumpEncoder encoder = new HexDumpEncoder(); in encode() local 169 encoder.encode(out.toByteArray())); in encode() 228 HexDumpEncoder encoder = new HexDumpEncoder(); in toString() local 229 sb.append(encoder.encode(issuerNameHash)); in toString() 231 sb.append(encoder.encode(issuerKeyHash)); in toString()
|
/libcore/ojluni/src/main/java/sun/nio/cs/ |
D | StreamEncoder.java | 174 private CharsetEncoder encoder; field in StreamEncoder 198 this.encoder = enc; in StreamEncoder() 215 this.encoder = enc; in StreamEncoder() 254 CoderResult cr = encoder.encode(lcb, bb, endOfInput); in flushLeftoverChar() 289 CoderResult cr = encoder.encode(cb, bb, false); in implWrite() 322 CoderResult cr = encoder.flush(bb); in implClose() 340 encoder.reset(); in implClose()
|
/libcore/ojluni/src/main/java/sun/security/x509/ |
D | KeyIdentifier.java | 116 HexDumpEncoder encoder = new HexDumpEncoder(); in toString() local 117 s += encoder.encodeBuffer(octetString); in toString()
|
/libcore/ojluni/src/main/java/java/nio/charset/ |
D | Charset-X-Coder.java.template | 99 #if[encoder] 102 #end[encoder] 187 {#if[encoder]?protected:private} 193 #if[encoder] // Android-added 208 #end[encoder] 287 #if[encoder] 289 #end[encoder] 305 #if[encoder] 309 #end[encoder] 327 #if[encoder] [all …]
|
/libcore/ojluni/src/main/java/java/util/zip/ |
D | ZipCoder.java | 79 ByteBuffer bb = encoder().encode(CharBuffer.wrap(s)); in getBytes() 164 private CharsetEncoder encoder() { in encoder() method in ZipCoder
|