/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
D | CharsetEncoderTest.java | 48 CharsetEncoder encoder; field in CharsetEncoderTest 66 encoder = cs.newEncoder(); in setUp() 68 byte[] replacement = encoder.replacement(); in setUp() 85 assertTrue(encoder.averageBytesPerChar() == AVER_BYTES); in testSpecificDefaultValue() 86 assertTrue(encoder.maxBytesPerChar() == MAX_BYTES); in testSpecificDefaultValue() 90 assertEquals(CodingErrorAction.REPORT, encoder.malformedInputAction()); in testDefaultValue() 91 assertEquals(CodingErrorAction.REPORT, encoder.unmappableCharacterAction()); in testDefaultValue() 92 assertSame(encoder, encoder.onMalformedInput(CodingErrorAction.IGNORE)); in testDefaultValue() 93 assertSame(encoder, encoder.onUnmappableCharacter(CodingErrorAction.IGNORE)); in testDefaultValue() 94 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 | 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 | 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 | 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 | 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/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/nio/cs/ |
D | StreamEncoder.java | 162 private CharsetEncoder encoder; field in StreamEncoder 186 this.encoder = enc; in StreamEncoder() 203 this.encoder = enc; in StreamEncoder() 242 CoderResult cr = encoder.encode(lcb, bb, endOfInput); in flushLeftoverChar() 271 CoderResult cr = encoder.encode(cb, bb, false); in implWrite() 304 CoderResult cr = encoder.flush(bb); in implClose() 322 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()
|
D | X509Key.java | 352 HexDumpEncoder encoder = new HexDumpEncoder(); in toString() local 355 + ", unparsed keybits = \n" + encoder.encodeBuffer(key); in toString()
|
D | X509CRLImpl.java | 593 HexDumpEncoder encoder = new HexDumpEncoder(); in toString() local 594 sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) in toString()
|
D | X509CertImpl.java | 825 HexDumpEncoder encoder = new HexDumpEncoder(); in toString() local 826 sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); in toString()
|
/libcore/ojluni/src/main/java/java/util/zip/ |
D | ZipCoder.java | 77 CharsetEncoder ce = encoder().reset(); in getBytes() 151 private CharsetEncoder encoder() { in encoder() method in ZipCoder
|
/libcore/ojluni/src/main/java/sun/nio/fs/ |
D | UnixPath.java | 46 private static ThreadLocal<SoftReference<CharsetEncoder>> encoder = field in UnixPath 120 SoftReference<CharsetEncoder> ref = encoder.get(); in encode() 126 encoder.set(new SoftReference<CharsetEncoder>(ce)); in encode()
|
/libcore/ojluni/src/main/java/java/nio/file/ |
D | Files.java | 2859 CharsetEncoder encoder = cs.newEncoder(); 2860 Writer writer = new OutputStreamWriter(newOutputStream(path, options), encoder); 3350 CharsetEncoder encoder = cs.newEncoder(); 3352 try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) {
|