Home
last modified time | relevance | path

Searched refs:decoder (Results 1 – 16 of 16) sorted by relevance

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetDecoderTest.java47 protected static CharsetDecoder decoder; field in CharsetDecoderTest
53 decoder = cs.newDecoder(); in setUp()
70 assertSame(cs, decoder.charset()); in testDefaultValues()
72 decoder.detectedCharset(); in testDefaultValues()
77 assertTrue(decoder.isCharsetDetected()); in testDefaultValues()
81 assertFalse(decoder.isAutoDetecting()); in testDefaultValues()
82 assertSame(CodingErrorAction.REPORT, decoder.malformedInputAction()); in testDefaultValues()
83 assertSame(CodingErrorAction.REPORT, decoder in testDefaultValues()
85 assertEquals(decoder.replacement(), "\ufffd"); in testDefaultValues()
93 decoder = new MockCharsetDecoder(cs, (float) AVER_BYTES, MAX_BYTES); in testCharsetDecoder()
[all …]
DCharsetDecoder2Test.java185 MockMalformedDecoder decoder = new MockMalformedDecoder(cs); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow() local
186 decoder.onMalformedInput(CodingErrorAction.REPLACE); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow()
187 decoder.replaceWith(replaceString); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow()
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()
250 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testInvalidDecoding() local
251 decoder.onMalformedInput(CodingErrorAction.REPORT); in testInvalidDecoding()
252 decoder.onUnmappableCharacter(CodingErrorAction.REPORT); in testInvalidDecoding()
259 CharBuffer cb = decoder.decode(ByteBuffer.wrap(bytes)); in testInvalidDecoding()
272 CharBuffer cb = decoder.decode(bb); in testInvalidDecoding()
DUTF16CharsetEncoderTest.java34 private static final CharsetDecoder decoder = CS.newDecoder(); field in UTF16CharsetEncoderTest
122 assertEquals(decoder.decode(out), decoder.decode(ByteBuffer in assertByteArray()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetDecoderTest.java41 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_no_offset() local
45 decoder.reset(); in test_ByteArray_decode_no_offset()
46 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true); in test_ByteArray_decode_no_offset()
48 decoder.flush(outBuffer); in test_ByteArray_decode_no_offset()
55 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_with_offset() local
61 decoder.reset(); in test_ByteArray_decode_with_offset()
62 CoderResult coderResult = decoder.decode(inBuffer, outBuffer, true); in test_ByteArray_decode_with_offset()
64 decoder.flush(outBuffer); in test_ByteArray_decode_with_offset()
71 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_with_offset_using_facade_method() local
75 CharBuffer outBuffer = decoder.decode(ByteBuffer.wrap(arr, offset, arr.length - offset)); in test_ByteArray_decode_with_offset_using_facade_method()
[all …]
DOldCharsetEncoderDecoderBufferTest.java38 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testDecoderOutputBuffer() local
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()
70 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testDecoderInputBuffer() local
76 decoder.decode(inWithArray, out, false); in testDecoderInputBuffer()
83 decoder.decode(inWithoutArray, out, true); in testDecoderInputBuffer()
DOldCharset_SingleByteAbstractTest.java51 decoder.onMalformedInput(CodingErrorAction.REPLACE); in dumpDecoded()
53 outputCB = decoder.decode(inputBB); in dumpDecoded()
67 decoder.onMalformedInput(CodingErrorAction.REPLACE); in decodeReplace()
68 decoder.onUnmappableCharacter(CodingErrorAction.REPLACE); in decodeReplace()
69 outputCB = decoder.decode(inputBB); in decodeReplace()
DOldCharset_AbstractTest.java35 static CharsetDecoder decoder; field in OldCharset_AbstractTest
62 decoder = charset.newDecoder(); in setUp()
125 decoder.onMalformedInput(CodingErrorAction.REPORT); in decode()
126 CharBuffer outputCB = decoder.decode(inputBB); in decode()
149 decoder.onMalformedInput(CodingErrorAction.REPORT); in NNtest_CodecDynamicIndividuals()
161 CharBuffer outputCB = decoder.decode(intermediateBB); in NNtest_CodecDynamicIndividuals()
178 decoder.onMalformedInput(CodingErrorAction.REPORT); in test_CodecDynamic()
194 CharBuffer outputCB = decoder.decode(intermediateBB); in test_CodecDynamic()
DOldCharset_MultiByte_EUC_JP.java36 decoder.onMalformedInput(CodingErrorAction.REPORT); in test_CodecDynamic()
47 CharBuffer outputCB = decoder.decode(intermediateBB); in test_CodecDynamic()
DCharset_TestGenerator.java32 CharsetDecoder decoder; field in Charset_TestGenerator
235 CharsetDecoder decoder = charset.newDecoder(); in genDecoded() local
/libcore/luni/src/main/java/java/io/
DInputStreamReader.java43 private CharsetDecoder decoder; field in InputStreamReader
83 decoder = Charset.forName(charsetName).newDecoder().onMalformedInput( in InputStreamReader()
106 decoder = dec; in InputStreamReader()
122 decoder = charset.newDecoder().onMalformedInput( in InputStreamReader()
138 if (decoder != null) { in close()
139 decoder.reset(); in close()
141 decoder = null; in close()
159 return decoder.charset().name(); in getEncoding()
244 result = decoder.decode(bytes, out, false); in read()
260 result = decoder.decode(bytes, out, true); in read()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
DASN1Type.java95 DerInputStream decoder = new DerInputStream(encoded); in verify() local
96 decoder.setVerify(); in verify()
97 decode(decoder); in verify()
101 DerInputStream decoder = new DerInputStream(in); in verify() local
102 decoder.setVerify(); in verify()
103 decode(decoder); in verify()
/libcore/luni/src/main/java/libcore/icu/
DNativeConverter.java55 public static void setCallbackDecode(long converterHandle, CharsetDecoder decoder) { in setCallbackDecode() argument
57 translateCodingErrorAction(decoder.malformedInputAction()), in setCallbackDecode()
58 translateCodingErrorAction(decoder.unmappableCharacterAction()), in setCallbackDecode()
59 decoder.replacement()); in setCallbackDecode()
/libcore/luni/src/main/java/java/nio/charset/
DCharsetEncoder.java97 private CharsetDecoder decoder; field in CharsetEncoder
534 if (decoder == null) { in isLegalReplacement()
535 decoder = charset.newDecoder(); in isLegalReplacement()
536 decoder.onMalformedInput(CodingErrorAction.REPORT); in isLegalReplacement()
537 decoder.onUnmappableCharacter(CodingErrorAction.REPORT); in isLegalReplacement()
540 … CharBuffer out = CharBuffer.allocate((int) (replacement.length * decoder.maxCharsPerByte())); in isLegalReplacement()
541 CoderResult result = decoder.decode(in, out, true); in isLegalReplacement()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DInputStreamReaderTest.java280 CharsetDecoder decoder = Charset.forName("utf-8").newDecoder(); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder() local
282 reader = new InputStreamReader(null, decoder); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder()
293 InputStreamReader reader2 = new InputStreamReader(in, decoder); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder()
294 assertEquals(Charset.forName(reader2.getEncoding()), decoder.charset()); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder()
381 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in test_read_1() local
382 decoder.onMalformedInput(CodingErrorAction.REPORT); in test_read_1()
384 new ByteArrayInputStream(new byte[] { -32, -96 }), decoder); in test_read_1()
/libcore/luni/src/main/java/java/nio/channels/
DChannels.java130 CharsetDecoder decoder, int minBufferCapacity) { in newReader() argument
135 return new InputStreamReader(new ChannelInputStream(channel), decoder); in newReader()
/libcore/luni/src/test/java/libcore/java/lang/
DStringTest.java347 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in test_23831() local
348 decoder.onMalformedInput(CodingErrorAction.REPLACE); in test_23831()
349 assertEquals(expected, decoder.decode(ByteBuffer.wrap(bytes)).toString()); in test_23831()