Home
last modified time | relevance | path

Searched refs:buffers (Results 1 – 18 of 18) sorted by relevance

/libcore/ojluni/src/test/java/nio/Buffer/
DChars.java89 static void addCases(CharBuffer cb, List<CharBuffer> buffers) { in addCases() argument
91 buffers.add(cb); in addCases()
93 buffers.add(cb.slice()); in addCases()
94 buffers.add(cb.duplicate()); in addCases()
95 buffers.add(cb.asReadOnlyBuffer()); in addCases()
97 buffers.add(randomizeRange(cb.slice())); in addCases()
98 buffers.add(randomizeRange(cb.duplicate())); in addCases()
99 buffers.add(randomizeRange(cb.asReadOnlyBuffer())); in addCases()
104 List<CharBuffer> buffers = new ArrayList<>(); in createCharBuffers() local
107 addCases(CharBuffer.allocate(SIZE), buffers); in createCharBuffers() local
[all …]
DBasic-X.java.template405 // Freshly created direct byte buffers should be aligned at index 0
413 // For heap byte buffers misalignment may occur on 32-bit systems
490 // mapped buffers
844 fail("Identical buffers not equal", b, b2);
855 fail("Non-identical buffers equal", b, b2);
862 fail("Non-identical buffers equal", b, b2);
1043 // Bulk puts from read-only buffers
1050 // For byte buffers, test both the direct and non-direct cases
/libcore/ojluni/src/main/java/sun/nio/fs/
DNativeBuffers.java58 NativeBuffer[] buffers = threadLocal.get(); in getNativeBufferFromCache() local
59 if (buffers != null) { in getNativeBufferFromCache()
61 NativeBuffer buffer = buffers[i]; in getNativeBufferFromCache()
63 buffers[i] = null; in getNativeBufferFromCache()
92 NativeBuffer[] buffers = threadLocal.get(); in releaseNativeBuffer() local
93 if (buffers == null) { in releaseNativeBuffer()
94 buffers = new NativeBuffer[TEMP_BUF_POOL_SIZE]; in releaseNativeBuffer()
95 buffers[0] = buffer; in releaseNativeBuffer()
96 threadLocal.set(buffers); in releaseNativeBuffer()
101 if (buffers[i] == null) { in releaseNativeBuffer()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DUtil.java109 private ByteBuffer[] buffers; field in Util.BufferCache
122 buffers = new ByteBuffer[TEMP_BUF_POOL_SIZE]; in BufferCache()
136 ByteBuffer[] buffers = this.buffers; in get()
139 ByteBuffer buf = buffers[start]; in get()
144 ByteBuffer bb = buffers[i]; in get()
155 buffers[i] = buffers[start]; in get()
159 buffers[start] = null; in get()
177 buffers[start] = buf; in offerFirst()
191 buffers[next] = buf; in offerLast()
203 ByteBuffer buf = buffers[start]; in removeFirst()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/channels/
DFileChannelTest.java95 … ByteBuffer[] buffers = new ByteBuffer[] { ByteBuffer.allocateDirect(4), ByteBuffer.allocate(4) }; in test_readv() local
96 assertEquals(8, fc.read(buffers)); in test_readv()
98 assertEquals(8, buffers[0].limit() + buffers[1].limit()); in test_readv()
100 buffers[0].flip(); in test_readv()
101 buffers[0].get(bytes); in test_readv()
103 buffers[1].flip(); in test_readv()
104 buffers[1].get(bytes); in test_readv()
112 … ByteBuffer[] buffers = new ByteBuffer[] { ByteBuffer.allocateDirect(4), ByteBuffer.allocate(4) }; in test_writev() local
113 buffers[0].put("abcd".getBytes("US-ASCII")).flip(); in test_writev()
114 buffers[1].put("ABCD".getBytes("US-ASCII")).flip(); in test_writev()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DSocketChannelTest.java2919 ByteBuffer[] buffers = new ByteBuffer[3]; in test_write$LByteBuffer2() local
2920 buffers[0] = ByteBuffer.wrap(data, 0, 6); in test_write$LByteBuffer2()
2921 buffers[1] = ByteBuffer.wrap(data, 6, data.length - 6); in test_write$LByteBuffer2()
2922 buffers[2] = ByteBuffer.wrap(data); in test_write$LByteBuffer2()
2925 client.write(buffers); in test_write$LByteBuffer2()
2951 ByteBuffer[] buffers = new ByteBuffer[3]; in test_write$LByteBuffer_buffers() local
2952 buffers[0] = ByteBuffer.wrap(data, 0, 2); in test_write$LByteBuffer_buffers()
2953 assertFalse(buffers[0].isDirect()); in test_write$LByteBuffer_buffers()
2954 assertTrue(buffers[0].hasArray()); in test_write$LByteBuffer_buffers()
2956 buffers[1] = ByteBuffer.wrap(data, 2, 4).asReadOnlyBuffer(); in test_write$LByteBuffer_buffers()
[all …]
DFileChannelTest.java1419 ByteBuffer[] buffers = new ByteBuffer[2]; in test_read$LByteBuffer_mock() local
1420 mockChannel.read(buffers); in test_read$LByteBuffer_mock()
/libcore/ojluni/src/main/java/java/nio/
DX-Buffer.java.template53 * $type$ buffers:
77 * <li><p> Methods for creating <i><a href="#views">view buffers</a></i>,
88 * <p> $Type$ buffers can be created either by {@link #allocate
107 * <h2> Direct <i>vs.</i> non-direct buffers </h2>
118 * buffers returned by this method typically have somewhat higher allocation
119 * and deallocation costs than non-direct buffers. The contents of direct
120 * buffers may reside outside of the normal garbage-collected heap, and so
122 * obvious. It is therefore recommended that direct buffers be allocated
123 * primarily for large, long-lived buffers that are subject to the underlying
125 * buffers only when they yield a measurable gain in program performance.
[all …]
DX-Buffer-bin.java.template127 * buffer, and vice versa; the two buffers' position, limit, and mark
DDirect-X-Buffer.java.template178 // For memory-mapped buffers -- invoked by FileChannelImpl via reflection
/libcore/luni/src/main/java/libcore/io/
DBlockGuardOs.java343 …@Override public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) t… in readv() argument
345 return super.readv(fd, buffers, offsets, byteCounts); in readv()
452 …@Override public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) … in writev() argument
454 return super.writev(fd, buffers, offsets, byteCounts); in writev()
DForwardingOs.java629 …ptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOEx… in readv() argument
948 …tor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOExc… in writev() argument
DOs.java533 …public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws Errn… in readv() argument
779 …public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws Err… in writev() argument
DLinux.java195 …public native int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) thro… in readv() argument
299 …public native int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) thr… in writev() argument
/libcore/luni/src/main/java/android/system/
DOs.java604 … fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOExcept… in readv() argument
997 …fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException, InterruptedIOExcepti… in writev() argument
/libcore/ojluni/src/main/java/java/nio/charset/
DCharset-X-Coder.java.template49 * of such buffers. The output $otype$ sequence is written to a $otype$ buffer
50 * or a series of such buffers. $A$ $coder$ should always be used by making
509 * <p> The buffers are read from, and written to, starting at their current
512 * $otype$s will be written. The buffers' positions will be advanced to
772 * <p> The buffers are read from, and written to, starting at their current
775 * $otype$s will be written. The buffers' positions will be advanced to
954 // BEGIN Android-added: Fast path handling for empty buffers.
955 // Empty buffers can always be "encoded".
959 // END Android-added: Fast path handling for empty buffers.
/libcore/luni/src/main/native/
Dlibcore_io_Linux.cpp2162 static jint Linux_readv(JNIEnv* env, jobject, jobject javaFd, jobjectArray buffers, jintArray offse… in Linux_readv() argument
2163 IoVec<ScopedBytesRW> ioVec(env, env->GetArrayLength(buffers)); in Linux_readv()
2164 if (!ioVec.init(buffers, offsets, byteCounts)) { in Linux_readv()
2753 static jint Linux_writev(JNIEnv* env, jobject, jobject javaFd, jobjectArray buffers, jintArray offs… in Linux_writev() argument
2754 IoVec<ScopedBytesRO> ioVec(env, env->GetArrayLength(buffers)); in Linux_writev()
2755 if (!ioVec.init(buffers, offsets, byteCounts)) { in Linux_writev()
/libcore/luni/src/test/java/libcore/java/nio/
DBufferTest.java651 final ByteBuffer [] buffers = { in testAlignedSliceOffset() local
658 for (ByteBuffer buffer: buffers) { in testAlignedSliceOffset()