Home
last modified time | relevance | path

Searched refs:wrap (Results 1 – 25 of 146) sorted by relevance

123456

/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()
92 CharBuffer buffer1 = CharBuffer.wrap("\ud800"); in testMultiStepEncode()
93 CharBuffer buffer2 = CharBuffer.wrap("\udc00"); in testMultiStepEncode()
108 CharBuffer cb = CharBuffer.wrap(chars); in testEncodeMapping()
113 CharBuffer cb = CharBuffer.wrap("\u0080"); in testEncodeMapping()
120 cb = CharBuffer.wrap("\ud800"); in testEncodeMapping()
128 cb = CharBuffer.wrap("A"); in testEncodeMapping()
139 CharBuffer in = CharBuffer.wrap("A"); in testInternalState()
145 in = CharBuffer.wrap("B"); 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()
282 CharBuffer in = CharBuffer.wrap("aaa"); in testFlushIllegalState()
328 CharBuffer in = CharBuffer.wrap("aaa"); in testEncodeFacadeIllegalState()
349 encoder.encode(CharBuffer.wrap("testCanEncodeIllegalState2"), in testEncodeFacadeIllegalState()
356 encoder.encode(CharBuffer.wrap("testCanEncodeIllegalState3"), in testEncodeFacadeIllegalState()
363 encoder.encode(CharBuffer.wrap("testCanEncodeIllegalState4"), in testEncodeFacadeIllegalState()
372 CharBuffer in = CharBuffer.wrap("aaa"); in testEncodeTrueIllegalState()
384 encoder.encode(CharBuffer.wrap("testCanEncodeIllegalState2"), in testEncodeTrueIllegalState()
[all …]
DISOCharsetEncoderTest.java68 return CharBuffer.wrap("\ud800 buffer"); in getMalformedCharBuffer()
72 return CharBuffer.wrap("\ud800\udc00 buffer"); in getUnmapCharBuffer()
87 encoder.encode(CharBuffer.wrap("\ud800\udc00")); in testMultiStepEncode()
DCharsetDecoder2Test.java94 ByteBuffer in = ByteBuffer.wrap(new byte[] { 109, 97, 109 }); in test_decode()
112 ByteBuffer.wrap(new byte[] { 0x00, 0x11 })); in test_decodeLjava_nio_ByteBuffer()
121 cs2.decode(ByteBuffer.wrap(new byte[] { 0x00, 0x11 })); in test_decodeLjava_nio_ByteBuffer()
191 ByteBuffer in = ByteBuffer.wrap(new byte[] { 0x45, 0x38, 0x45, 0x45 }); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow()
259 CharBuffer cb = decoder.decode(ByteBuffer.wrap(bytes)); in testInvalidDecoding()
DCharsetEncoder2Test.java111 cs.encode(CharBuffer.wrap("AB")); in test_EncodeLjava_nio_CharBuffer()
160 CharBuffer char1 = CharBuffer.wrap("\ud800"); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
161 CharBuffer char2 = CharBuffer.wrap("\udc00"); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
203 Charset.forName("UTF-8").encode(CharBuffer.wrap(s)); in testUtf8Encoding()
DUTF16CharsetDecoderTest.java58 return ByteBuffer.wrap(b); in getByteBuffer()
66 return ByteBuffer.wrap(bytes); in getHeadlessByteBuffer()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DWrappedFloatBufferTest.java23 buf = FloatBuffer.wrap(new float[BUFFER_LENGTH]); in setUp()
41 FloatBuffer.wrap(array, -1, 0); in testWrappedFloatBuffer_IllegalArg()
47 FloatBuffer.wrap(array, 21, 0); in testWrappedFloatBuffer_IllegalArg()
53 FloatBuffer.wrap(array, 0, -1); in testWrappedFloatBuffer_IllegalArg()
59 FloatBuffer.wrap(array, 0, 21); in testWrappedFloatBuffer_IllegalArg()
65 FloatBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedFloatBuffer_IllegalArg()
71 FloatBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedFloatBuffer_IllegalArg()
77 FloatBuffer.wrap((float[])null, -1, 0); in testWrappedFloatBuffer_IllegalArg()
82 FloatBuffer buf = FloatBuffer.wrap(array, 2, 16); in testWrappedFloatBuffer_IllegalArg()
DWrappedLongBufferTest.java23 buf = LongBuffer.wrap(new long[BUFFER_LENGTH]); in setUp()
41 LongBuffer.wrap(array, -1, 0); in testWrappedLongBuffer_IllegalArg()
47 LongBuffer.wrap(array, 21, 0); in testWrappedLongBuffer_IllegalArg()
53 LongBuffer.wrap(array, 0, -1); in testWrappedLongBuffer_IllegalArg()
59 LongBuffer.wrap(array, 0, 21); in testWrappedLongBuffer_IllegalArg()
65 LongBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedLongBuffer_IllegalArg()
71 LongBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedLongBuffer_IllegalArg()
77 LongBuffer.wrap((long[])null, -1, 0); in testWrappedLongBuffer_IllegalArg()
82 LongBuffer buf = LongBuffer.wrap(array, 2, 16); in testWrappedLongBuffer_IllegalArg()
DWrappedDoubleBufferTest.java23 buf = DoubleBuffer.wrap(new double[BUFFER_LENGTH]); in setUp()
41 DoubleBuffer.wrap(array, -1, 0); in testWrappedDoubleuffer_IllegalArg()
47 DoubleBuffer.wrap(array, 21, 0); in testWrappedDoubleuffer_IllegalArg()
53 DoubleBuffer.wrap(array, 0, -1); in testWrappedDoubleuffer_IllegalArg()
59 DoubleBuffer.wrap(array, 0, 21); in testWrappedDoubleuffer_IllegalArg()
65 DoubleBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedDoubleuffer_IllegalArg()
71 DoubleBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedDoubleuffer_IllegalArg()
77 DoubleBuffer.wrap((double[])null, -1, 0); in testWrappedDoubleuffer_IllegalArg()
82 DoubleBuffer buf = DoubleBuffer.wrap(array, 2, 16); in testWrappedDoubleuffer_IllegalArg()
DWrappedIntBufferTest.java23 buf = IntBuffer.wrap(new int[BUFFER_LENGTH]); in setUp()
41 IntBuffer.wrap(array, -1, 0); in testWrappedIntBuffer_IllegalArg()
47 IntBuffer.wrap(array, 21, 0); in testWrappedIntBuffer_IllegalArg()
53 IntBuffer.wrap(array, 0, -1); in testWrappedIntBuffer_IllegalArg()
59 IntBuffer.wrap(array, 0, 21); in testWrappedIntBuffer_IllegalArg()
65 IntBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedIntBuffer_IllegalArg()
71 IntBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedIntBuffer_IllegalArg()
77 IntBuffer.wrap((int[])null, -1, 0); in testWrappedIntBuffer_IllegalArg()
82 IntBuffer buf = IntBuffer.wrap(array, 2, 16); in testWrappedIntBuffer_IllegalArg()
DWrappedShortBufferTest.java23 buf = ShortBuffer.wrap(new short[BUFFER_LENGTH]); in setUp()
41 ShortBuffer.wrap(array, -1, 0); in testWrappedShortBuffer_IllegalArg()
47 ShortBuffer.wrap(array, 21, 0); in testWrappedShortBuffer_IllegalArg()
53 ShortBuffer.wrap(array, 0, -1); in testWrappedShortBuffer_IllegalArg()
59 ShortBuffer.wrap(array, 0, 21); in testWrappedShortBuffer_IllegalArg()
65 ShortBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedShortBuffer_IllegalArg()
71 ShortBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedShortBuffer_IllegalArg()
77 ShortBuffer.wrap((short[])null, -1, 0); in testWrappedShortBuffer_IllegalArg()
82 ShortBuffer buf = ShortBuffer.wrap(array, 2, 16); in testWrappedShortBuffer_IllegalArg()
DWrappedCharBufferTest1.java25 buf = CharBuffer.wrap(new char[BUFFER_LENGTH]); in setUp()
43 CharBuffer.wrap(array, -1, 0); in testWrappedCharBuffer_IllegalArg()
49 CharBuffer.wrap(array, BUFFER_LENGTH + 1, 0); in testWrappedCharBuffer_IllegalArg()
55 CharBuffer.wrap(array, 0, -1); in testWrappedCharBuffer_IllegalArg()
61 CharBuffer.wrap(array, 0, BUFFER_LENGTH + 1); in testWrappedCharBuffer_IllegalArg()
67 CharBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedCharBuffer_IllegalArg()
73 CharBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedCharBuffer_IllegalArg()
79 CharBuffer.wrap((char[])null, -1, 0); in testWrappedCharBuffer_IllegalArg()
DWrappedByteBufferTest.java25 buf = ByteBuffer.wrap(new byte[BUFFER_LENGTH]); in setUp()
42 ByteBuffer.wrap(array, -1, 0); in testWrappedByteBuffer_IllegalArg()
48 ByteBuffer.wrap(array, BUFFER_LENGTH + 1, 0); in testWrappedByteBuffer_IllegalArg()
54 ByteBuffer.wrap(array, 0, -1); in testWrappedByteBuffer_IllegalArg()
60 ByteBuffer.wrap(array, 0, BUFFER_LENGTH + 1); in testWrappedByteBuffer_IllegalArg()
66 ByteBuffer.wrap(array, 1, Integer.MAX_VALUE); in testWrappedByteBuffer_IllegalArg()
72 ByteBuffer.wrap(array, Integer.MAX_VALUE, 1); in testWrappedByteBuffer_IllegalArg()
78 ByteBuffer.wrap((byte[])null, 1, Integer.MAX_VALUE); in testWrappedByteBuffer_IllegalArg()
DWrappedCharBufferTest2.java28 buf = CharBuffer.wrap(TEST_STRING); in setUp()
41 CharBuffer.wrap(str, -1, 0); in testWrappedCharSequence_IllegalArg()
47 CharBuffer.wrap(str, 21, 21); in testWrappedCharSequence_IllegalArg()
53 CharBuffer.wrap(str, 2, 1); in testWrappedCharSequence_IllegalArg()
59 CharBuffer.wrap(str, 0, 21); in testWrappedCharSequence_IllegalArg()
65 CharBuffer.wrap((String)null, -1, 21); in testWrappedCharSequence_IllegalArg()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DOldCharsetEncoderDecoderBufferTest.java41 CharBuffer out = CharBuffer.wrap(cBuf); in testDecoderOutputBuffer()
43 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'a', (byte)'b', (byte)'c', (byte)'d'}), in testDecoderOutputBuffer()
51 out = ByteBuffer.wrap(bBuf).asCharBuffer(); in testDecoderOutputBuffer()
53 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'x'}), out, true); in testDecoderOutputBuffer()
71 CharBuffer out = CharBuffer.wrap(new char[10]); in testDecoderInputBuffer()
74 ByteBuffer inWithArray = ByteBuffer.wrap(inArray); in testDecoderInputBuffer()
81 ByteBuffer inWithoutArray = ByteBuffer.wrap(new byte[] { (byte) 'x' }).asReadOnlyBuffer(); in testDecoderInputBuffer()
99 ByteBuffer out = ByteBuffer.wrap(buffer); in testEncoderOutputBuffer()
102 encoder.encode(CharBuffer.wrap("ab"), out, false); in testEncoderOutputBuffer()
114 encoder.encode(CharBuffer.wrap("x"), out, true); in testEncoderOutputBuffer()
[all …]
DCharsetDecoderTest.java35 ByteBuffer in = ByteBuffer.wrap(new byte[] { 109, 97, 109 }); in test_replaceWith()
43 ByteBuffer inBuffer = ByteBuffer.wrap(arr, 0, arr.length).slice(); in test_ByteArray_decode_no_offset()
59 ByteBuffer inBuffer = ByteBuffer.wrap(arr, offset, arr.length - offset).slice(); 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()
88 ByteBuffer buf = encoder.encode(CharBuffer.wrap(s)); in encode()
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()
119 ByteBuffer.wrap(new byte[] { 'h', 'e', 'l', 'l', 'o'}), out, false); in testBufferWithNonZeroOffset()
DCharsetEncoderTest.java38 String output = ascii.decode(e.encode(CharBuffer.wrap(input))).toString(); in test_replaceWith()
72 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842', '\udf9f' }), bb, false); in testSurrogatePairAllAtOnce()
86 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false); in testMalformedSurrogatePair()
123 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842' }), bb, false); in testCharsetEncoderSplitSurrogates()
126 cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false); in testCharsetEncoderSplitSurrogates()
135 cr = e.encode(CharBuffer.wrap(new char[] { }), bb, true); in testCharsetEncoderSplitSurrogates()
147 CoderResult cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, false); in testFlushWithoutEndOfInput()
159 cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, true); in testFlushWithoutEndOfInput()
224 CoderResult result = encoder.encode(CharBuffer.wrap("\ud800"), output,
DOldCharset_SingleByteAbstractTest.java49 ByteBuffer inputBB = ByteBuffer.wrap(allBytes); in dumpDecoded()
65 ByteBuffer inputBB = ByteBuffer.wrap(input); in decodeReplace()
105 CharBuffer inputCB = CharBuffer.wrap(allChars); in test_Encode()
/libcore/ojluni/src/main/java/javax/net/ssl/
DSSLEngine.java1135 public SSLEngineResult wrap(ByteBuffer src, in wrap() method in SSLEngine
1137 return wrap(new ByteBuffer [] { src }, 0, 1, dst); in wrap()
1172 public SSLEngineResult wrap(ByteBuffer [] srcs, in wrap() method in SSLEngine
1177 return wrap(srcs, 0, srcs.length, dst); in wrap()
1256 public abstract SSLEngineResult wrap(ByteBuffer [] srcs, int offset, in wrap() method in SSLEngine
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineTest.java325 …ByteBuffer bbs = ByteBuffer.wrap(new byte[] {1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3… in test_unwrap_01()
473 clientEngine.engine.wrap(new ByteBuffer[] { bbs }, 0, 1, bbd); in test_wrap_01()
490 sse.wrap(bbA, -1, 3, bb); in test_wrap_02()
495 sse.wrap(bbA, 0, -3, bb); in test_wrap_02()
500 sse.wrap(bbA, bbA.length + 1, bbA.length, bb); in test_wrap_02()
505 sse.wrap(bbA, 0, bbA.length + 1, bb); in test_wrap_02()
525 sse.wrap(bbA, 0, bbA.length, bb); in test_wrap_03()
546 e.wrap(bbA, 0, 3, bN); in test_wrap_04()
552 e.wrap(bbN, 0, 0, bN); in test_wrap_04()
571 SSLEngineResult result = sse.wrap(bbA, 0, bbA.length, bb); in test_wrap_05()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DAsynchronousFileChannelTest.java195 ByteBuffer buf = ByteBuffer.wrap(readBuf); in testRead_Future()
284 ByteBuffer buf = ByteBuffer.wrap(readBuf); in testRead_CompletionListener()
365 ByteBuffer buf = ByteBuffer.wrap(readBuf); in testWrite_Future()
380 assertEquals(2, (int) afc.write(ByteBuffer.wrap(new byte[] { 'x', 'y'}), 0).get()); in testWrite_Future()
392 assertEquals(3, (int) afc.write(ByteBuffer.wrap(new byte[] { 'x', 'y', 'z'}), 6).get()); in testWrite_Future()
404 assertEquals(2, (int) afc.write(ByteBuffer.wrap(new byte[] { 'x', 'y' }), 9).get()); in testWrite_Future()
414 assertEquals(2, (int) afc.write(ByteBuffer.wrap(new byte[] { '0', '2' }), 13).get()); in testWrite_Future()
455 ByteBuffer buf = ByteBuffer.wrap(readBuf); in testWrite_CompletionListener()
475 afc.write(ByteBuffer.wrap(new byte[] { 'x', 'y'}), 0, attachment, handler); in testWrite_CompletionListener()
492 afc.write(ByteBuffer.wrap(new byte[] { 'x', 'y', 'z'}), 6, attachment, handler); in testWrite_CompletionListener()
[all …]
/libcore/ojluni/annotations/hiddenapi/java/nio/
DCharBuffer.java54 public static java.nio.CharBuffer wrap(char[] array, int offset, int length) { in wrap() method in CharBuffer
58 public static java.nio.CharBuffer wrap(char[] array) { in wrap() method in CharBuffer
66 public static java.nio.CharBuffer wrap(java.lang.CharSequence csq, int start, int end) { in wrap() method in CharBuffer
70 public static java.nio.CharBuffer wrap(java.lang.CharSequence csq) { in wrap() method in CharBuffer
/libcore/ojluni/src/main/java/java/nio/
DCharBuffer.java206 public static CharBuffer wrap(char[] array, in wrap() method in CharBuffer
232 public static CharBuffer wrap(char[] array) { in wrap() method in CharBuffer
233 return wrap(array, 0, array.length); in wrap()
300 public static CharBuffer wrap(CharSequence csq, int start, int end) { in wrap() method in CharBuffer
322 public static CharBuffer wrap(CharSequence csq) { in wrap() method in CharBuffer
323 return wrap(csq, 0, csq.length()); in wrap()
/libcore/ojluni/src/main/java/java/util/zip/
DZipCoder.java61 ByteBuffer bb = ByteBuffer.wrap(ba, 0, length); in toString()
62 CharBuffer cb = CharBuffer.wrap(ca); in toString()
91 ByteBuffer bb = ByteBuffer.wrap(ba); in getBytes()
92 CharBuffer cb = CharBuffer.wrap(ca); in getBytes()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DDatagramChannelTest.java1131 ByteBuffer buf = ByteBuffer.wrap(new byte[CAPACITY_NORMAL]); in testReceiveSend_NonBlock_NotBound()
1257 channel2.send(ByteBuffer.wrap(str.getBytes()), datagramSocket1Address); in testReceiveSend_64K()
1265 assertEquals(data.length(), channel2.send(ByteBuffer.wrap(data.getBytes()), address)); in sendOnChannel2()
1277 ByteBuffer buf = ByteBuffer.wrap(new byte[bufSize]); in receiveOnChannel1AndClose()
1324 this.channel2.send(ByteBuffer.wrap(strHello.getBytes()), channel1Address); in testRead_fromSend()
1763 ByteBuffer targetBuf = ByteBuffer.wrap(targetArray); in testReadWrite_asyncClose()
1795 ByteBuffer sourceBuf = ByteBuffer.wrap(sourceArray); in testReadWrite_Block_Zero()
1799 ByteBuffer targetBuf = ByteBuffer.wrap(targetArray); in testReadWrite_Block_Zero()
1828 ByteBuffer sourceBuf = ByteBuffer.wrap(sourceArray); in testReadWrite_Block_Empty()
1832 ByteBuffer targetBuf = ByteBuffer.wrap(targetArray); in testReadWrite_Block_Empty()
[all …]

123456