/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/ |
D | SSLEngineTest.java | 21 import java.nio.ByteBuffer; 325 …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() 326 … ByteBuffer bbd = ByteBuffer.allocate(clientEngine.engine.getSession().getApplicationBufferSize()); in test_unwrap_01() 328 clientEngine.engine.unwrap(bbs, new ByteBuffer[] { bbd }, 0, 1); in test_unwrap_01() 342 …ByteBuffer[] bbA = { ByteBuffer.allocate(100), ByteBuffer.allocate(10), ByteBuffer.allocate(100) }; in test_unwrap_02() 344 ByteBuffer bb = ByteBuffer.allocate(10); in test_unwrap_02() 378 ByteBuffer bbR = ByteBuffer.allocate(100).asReadOnlyBuffer(); in test_unwrap_03() 379 ByteBuffer[] bbA = { bbR, ByteBuffer.allocate(10), ByteBuffer.allocate(100) }; in test_unwrap_03() 381 ByteBuffer bb = ByteBuffer.allocate(10); in test_unwrap_03() 400 … ByteBuffer[] bbA = {ByteBuffer.allocate(100), ByteBuffer.allocate(10), ByteBuffer.allocate(100)}; in test_unwrap_04() [all …]
|
/libcore/ojluni/annotations/mmodule/java/nio/ |
D | ByteBuffer.annotated.java | 34 public abstract class ByteBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.B… class 36 ByteBuffer(int mark, int pos, int lim, int cap) { super(0, 0, 0, 0, 0); throw new RuntimeException(… in ByteBuffer() method in ByteBuffer 38 public static java.nio.ByteBuffer allocateDirect(int capacity) { throw new RuntimeException("Stub!"… in allocateDirect() 40 public static java.nio.ByteBuffer allocate(int capacity) { throw new RuntimeException("Stub!"); } in allocate() 42 public static java.nio.ByteBuffer wrap(byte[] array, int offset, int length) { throw new RuntimeExc… in wrap() 44 public static java.nio.ByteBuffer wrap(byte[] array) { throw new RuntimeException("Stub!"); } in wrap() 46 public abstract java.nio.ByteBuffer slice(); in slice() 48 public abstract java.nio.ByteBuffer duplicate(); in duplicate() 50 public abstract java.nio.ByteBuffer asReadOnlyBuffer(); in asReadOnlyBuffer() 54 public abstract java.nio.ByteBuffer put(byte b); in put() [all …]
|
D | DirectByteBuffer.annotated.java | 49 public final java.nio.ByteBuffer slice() { throw new RuntimeException("Stub!"); } in slice() 52 public final java.nio.ByteBuffer duplicate() { throw new RuntimeException("Stub!"); } in duplicate() 55 public final java.nio.ByteBuffer asReadOnlyBuffer() { throw new RuntimeException("Stub!"); } in asReadOnlyBuffer() 69 public java.nio.ByteBuffer get(byte[] dst, int dstOffset, int length) { throw new RuntimeException(… in get() 72 public java.nio.ByteBuffer put(java.nio.ByteBuffer src) { throw new RuntimeException("Stub!"); } in put() 75 public final java.nio.ByteBuffer put(byte x) { throw new RuntimeException("Stub!"); } in put() 78 public final java.nio.ByteBuffer put(int i, byte x) { throw new RuntimeException("Stub!"); } in put() 81 public java.nio.ByteBuffer put(byte[] src, int srcOffset, int length) { throw new RuntimeException(… in put() 84 public final java.nio.ByteBuffer compact() { throw new RuntimeException("Stub!"); } in compact() 99 public final java.nio.ByteBuffer putChar(char x) { throw new RuntimeException("Stub!"); } in putChar() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/ |
D | SourceChannelTest.java | 20 import java.nio.ByteBuffer; 42 private ByteBuffer buffer; 44 private ByteBuffer positionedBuffer; 51 buffer = ByteBuffer.wrap("bytes".getBytes(ISO8859_1)); in setUp() 52 positionedBuffer = ByteBuffer.wrap("12345bytes".getBytes(ISO8859_1)); in setUp() 68 sink.write(ByteBuffer.allocate(1)); in test_read_LByteBuffer_DataAvailable() 69 int count = source.read(ByteBuffer.allocate(10)); in test_read_LByteBuffer_DataAvailable() 77 ByteBuffer nullBuf = null; in test_read_LByteBuffer_Exception() 90 ByteBuffer readBuf = ByteBuffer.allocate(BUFFER_SIZE); in test_read_LByteBuffer_SinkClosed() 108 ByteBuffer readBuf = ByteBuffer.allocate(BUFFER_SIZE); in test_read_LByteBuffer_SourceClosed() [all …]
|
D | SinkChannelTest.java | 22 import java.nio.ByteBuffer; 46 private ByteBuffer buffer; 48 private ByteBuffer positionedBuffer; 55 buffer = ByteBuffer.wrap("bytes".getBytes(ISO8859_1)); in setUp() 56 positionedBuffer = ByteBuffer.wrap("12345bytes".getBytes(ISO8859_1)); in setUp() 71 ByteBuffer[] bufArray = { buffer, positionedBuffer }; in test_write_LByteBuffer() 82 for (ByteBuffer buf : bufArray) { in test_write_LByteBuffer() 86 ByteBuffer readBuf = ByteBuffer.allocate(BUFFER_SIZE); in test_write_LByteBuffer() 114 sink.write(ByteBuffer.wrap(strbytes)); in test_write_LByteBuffer_mutliThread() 127 ByteBuffer readBuf = ByteBuffer.allocate(THREAD_NUM * BUFFER_SIZE); in test_write_LByteBuffer_mutliThread() [all …]
|
D | DatagramChannelTest.java | 29 import java.nio.ByteBuffer; 140 ByteBuffer[] readBuf = null; in testReadByteBufferArray() 155 readBuf = new ByteBuffer[bufSize]; in testReadByteBufferArray() 176 ByteBuffer[] readBuf = null; in testReadByteBufferArray_BufNull() 202 ByteBuffer[] readBuf = null; in testWriteByteBuffer() 215 readBuf = new ByteBuffer[bufSize]; in testWriteByteBuffer() 237 ByteBuffer[] readBuf = null; in testWriteByteBuffer_Bufnull() 685 ByteBuffer dst = ByteBuffer.allocateDirect(CAPACITY_NORMAL) in testReceive_UnconnectedReadonly() 702 ByteBuffer dst = ByteBuffer.allocateDirect(CAPACITY_NORMAL); in testReceive_UnconnectedBufEmpty() 711 ByteBuffer dst = ByteBuffer.allocateDirect(CAPACITY_ZERO); in testReceive_UnboundBufZero() [all …]
|
/libcore/ojluni/annotations/hiddenapi/java/nio/ |
D | ByteBuffer.java | 34 public abstract class ByteBuffer extends java.nio.Buffer class 35 implements java.lang.Comparable<java.nio.ByteBuffer> { 37 ByteBuffer(int mark, int pos, int lim, int cap, byte[] hb, int offset) { in ByteBuffer() method in ByteBuffer 42 ByteBuffer(int mark, int pos, int lim, int cap) { in ByteBuffer() method in ByteBuffer 47 public static java.nio.ByteBuffer allocateDirect(int capacity) { in allocateDirect() 51 public static java.nio.ByteBuffer allocate(int capacity) { in allocate() 55 public static java.nio.ByteBuffer wrap(byte[] array, int offset, int length) { in wrap() 59 public static java.nio.ByteBuffer wrap(byte[] array) { in wrap() 63 public abstract java.nio.ByteBuffer slice(); in slice() 65 public abstract java.nio.ByteBuffer duplicate(); in duplicate() [all …]
|
D | DirectByteBuffer.java | 87 public final java.nio.ByteBuffer slice() { in slice() 91 public final java.nio.ByteBuffer duplicate() { in duplicate() 95 public final java.nio.ByteBuffer asReadOnlyBuffer() { in asReadOnlyBuffer() 119 public java.nio.ByteBuffer get(byte[] dst, int dstOffset, int length) { in get() 123 private java.nio.ByteBuffer put(long a, byte x) { in put() 127 public java.nio.ByteBuffer put(java.nio.ByteBuffer src) { in put() 131 public final java.nio.ByteBuffer put(byte x) { in put() 135 public final java.nio.ByteBuffer put(int i, byte x) { in put() 139 public java.nio.ByteBuffer put(byte[] src, int srcOffset, int length) { in put() 143 public final java.nio.ByteBuffer compact() { in compact() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
D | ASCIICharsetEncoderTest.java | 20 import java.nio.ByteBuffer; 85 ByteBuffer out = ByteBuffer.allocate(10); in testMultiStepEncode() 91 out = ByteBuffer.allocate(10); in testMultiStepEncode() 109 ByteBuffer bb = encoder.encode(cb); in testEncodeMapping() 127 ByteBuffer bb = ByteBuffer.allocate(0x10); in testEncodeMapping() 140 ByteBuffer out = ByteBuffer.allocate(0x10); in testInternalState() 162 ByteBuffer out = ByteBuffer.allocate(0x10); in testInternalState_Reset() 170 ByteBuffer out = ByteBuffer.allocate(0x10); in testInternalState_Reset() 177 ByteBuffer out = ByteBuffer.allocate(0x10); in testInternalState_Reset() 189 ByteBuffer out = ByteBuffer.allocate(0x10); in testInternalState_Encoding() [all …]
|
D | UTFCharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException { in getUnmappedByteBuffer() 52 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException { in getMalformedByteBuffer() 53 ByteBuffer buffer = ByteBuffer.allocate(getByteBuffer().remaining() + 1); in getMalformedByteBuffer() 60 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray() 68 protected ByteBuffer getByteBuffer() { in getByteBuffer() 69 return ByteBuffer.wrap(new byte[] { 32, 98, 117, 102, 102, 101, 114, in getByteBuffer()
|
D | UTF16CharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 47 protected ByteBuffer getByteBuffer() { in getByteBuffer() 58 return ByteBuffer.wrap(b); in getByteBuffer() 61 protected ByteBuffer getHeadlessByteBuffer() { in getHeadlessByteBuffer() 62 ByteBuffer b = getByteBuffer(); in getHeadlessByteBuffer() 66 return ByteBuffer.wrap(bytes); in getHeadlessByteBuffer() 98 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException { in getUnmappedByteBuffer() 102 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException { in getMalformedByteBuffer() 115 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray()
|
D | UTF16BECharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException { in getUnmappedByteBuffer() 53 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException { in getMalformedByteBuffer() 64 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray() 68 protected ByteBuffer getByteBuffer() { in getByteBuffer() 69 return ByteBuffer.wrap(new byte[] { 0, 32, 0, 98, 0, 117, 0, 102, 0, in getByteBuffer()
|
D | UTF16LECharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException { in getUnmappedByteBuffer() 53 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException { in getMalformedByteBuffer() 64 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray() 68 protected ByteBuffer getByteBuffer() { in getByteBuffer() 69 return ByteBuffer.wrap(new byte[] { 32, 0, 98, 0, 117, 0, 102, 0, 102, in getByteBuffer()
|
D | ASCCharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 45 ByteBuffer getUnmappedByteBuffer() { in getUnmappedByteBuffer() 56 ByteBuffer getMalformedByteBuffer() { in getMalformedByteBuffer() 58 ByteBuffer buffer = ByteBuffer.allocate(8); in getMalformedByteBuffer() 68 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray()
|
D | GBCharsetDecoderTest.java | 20 import java.nio.ByteBuffer; 48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException { in getUnmappedByteBuffer() 52 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException { in getMalformedByteBuffer() 53 ByteBuffer buffer = ByteBuffer.allocate(20); in getMalformedByteBuffer() 60 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException { in getExceptionByteArray()
|
/libcore/ojluni/src/main/java/java/nio/ |
D | ByteBuffer.java | 207 public abstract class ByteBuffer class 209 implements Comparable<ByteBuffer> 223 ByteBuffer(int mark, int pos, int lim, int cap, // package-private in ByteBuffer() method in ByteBuffer 234 ByteBuffer(int mark, int pos, int lim, int cap) { // package-private in ByteBuffer() method in ByteBuffer 255 public static ByteBuffer allocateDirect(int capacity) { in allocateDirect() 279 public static ByteBuffer allocate(int capacity) { in allocate() 316 public static ByteBuffer wrap(byte[] array, in wrap() 342 public static ByteBuffer wrap(byte[] array) { in wrap() 364 public abstract ByteBuffer slice(); in slice() 381 public abstract ByteBuffer duplicate(); in duplicate() [all …]
|
/libcore/ojluni/src/main/java/javax/net/ssl/ |
D | SSLEngine.java | 28 import java.nio.ByteBuffer; 1135 public SSLEngineResult wrap(ByteBuffer src, in wrap() 1136 ByteBuffer dst) throws SSLException { in wrap() 1137 return wrap(new ByteBuffer [] { src }, 0, 1, dst); in wrap() 1172 public SSLEngineResult wrap(ByteBuffer [] srcs, in wrap() 1173 ByteBuffer dst) throws SSLException { in wrap() 1256 public abstract SSLEngineResult wrap(ByteBuffer [] srcs, int offset, in wrap() 1257 int length, ByteBuffer dst) throws SSLException; in wrap() 1290 public SSLEngineResult unwrap(ByteBuffer src, in unwrap() 1291 ByteBuffer dst) throws SSLException { in unwrap() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/ |
D | WrappedByteBufferTest.java | 19 import java.nio.ByteBuffer; 25 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()
|
/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | Util.java | 29 import java.nio.ByteBuffer; 100 private static boolean isBufferTooLarge(ByteBuffer buf) { in isBufferTooLarge() 109 private ByteBuffer[] buffers; 122 buffers = new ByteBuffer[TEMP_BUF_POOL_SIZE]; in BufferCache() 129 ByteBuffer get(int size) { in get() 136 ByteBuffer[] buffers = this.buffers; in get() 139 ByteBuffer buf = buffers[start]; in get() 144 ByteBuffer bb = buffers[i]; in get() 169 boolean offerFirst(ByteBuffer buf) { in offerFirst() 183 boolean offerLast(ByteBuffer buf) { in offerLast() [all …]
|
/libcore/luni/src/test/java/libcore/java/nio/charset/ |
D | OldCharsetEncoderDecoderBufferTest.java | 19 import java.nio.ByteBuffer; 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() 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() 108 out = ByteBuffer.allocateDirect(10); in testEncoderOutputBuffer() 129 ByteBuffer out = ByteBuffer.wrap(new byte[10]); in testEncoderInputBuffer()
|
/libcore/luni/src/test/java/libcore/java/nio/channels/ |
D | OldFileChannelTest.java | 26 import java.nio.ByteBuffer; 148 ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES); in test_forceZ() 260 ByteBuffer readBuffer = ByteBuffer.allocate(CAPACITY); in test_readLByteBufferJ_IllegalArgument() 504 ByteBuffer[] buffer) throws IOException{ in doTestForIOOBException() 544 ByteBuffer[] readBuffers = new ByteBuffer[2]; in test_read$LByteBufferII_IndexOutOfBound() 545 readBuffers[0] = ByteBuffer.allocate(CAPACITY); in test_read$LByteBufferII_IndexOutOfBound() 546 readBuffers[1] = ByteBuffer.allocate(CAPACITY); in test_read$LByteBufferII_IndexOutOfBound() 547 ByteBuffer[] readBuffersNull = new ByteBuffer[2]; in test_read$LByteBufferII_IndexOutOfBound() 609 ByteBuffer[] readBuffers = new ByteBuffer[2]; in test_read$LByteBufferII_EmptyFile() 610 readBuffers[0] = ByteBuffer.allocate(CAPACITY); in test_read$LByteBufferII_EmptyFile() [all …]
|
/libcore/ojluni/src/main/java/java/nio/channels/ |
D | DatagramChannel.java | 33 import java.nio.ByteBuffer; 398 public abstract SocketAddress receive(ByteBuffer dst) throws IOException; in receive() 463 public abstract int send(ByteBuffer src, SocketAddress target) in send() 482 public abstract int read(ByteBuffer dst) throws IOException; in read() 497 public abstract long read(ByteBuffer[] dsts, int offset, int length) in read() 513 public final long read(ByteBuffer[] dsts) throws IOException { in read() 528 public abstract int write(ByteBuffer src) throws IOException; in write() 547 public abstract long write(ByteBuffer[] srcs, int offset, int length) in write() 567 public final long write(ByteBuffer[] srcs) throws IOException { in write()
|
D | AsynchronousByteChannel.java | 28 import java.nio.ByteBuffer; 108 <A> void read(ByteBuffer dst, in read() 136 Future<Integer> read(ByteBuffer dst); in read() 187 <A> void write(ByteBuffer src, in write() 212 Future<Integer> write(ByteBuffer src); in write()
|
/libcore/luni/src/test/java/libcore/java/nio/ |
D | BufferTest.java | 29 import java.nio.ByteBuffer; 51 private static ByteBuffer allocateMapped(int size) throws Exception { in allocateMapped() 63 testByteSwappedBulkGet(ByteBuffer.allocateDirect(10)); in testByteSwappedBulkGetDirect() 67 testByteSwappedBulkGet(ByteBuffer.allocate(10)); in testByteSwappedBulkGetHeap() 74 private void testByteSwappedBulkGet(ByteBuffer b) throws Exception { in testByteSwappedBulkGet() 147 private static String toString(ByteBuffer b) { in toString() 156 testByteSwappedBulkPut(ByteBuffer.allocateDirect(10)); in testByteSwappedBulkPutDirect() 160 testByteSwappedBulkPut(ByteBuffer.allocate(10)); in testByteSwappedBulkPutHeap() 167 private void testByteSwappedBulkPut(ByteBuffer b) throws Exception { in testByteSwappedBulkPut() 209 testByteBufferByteOrder(ByteBuffer.allocateDirect(10), false); in testByteBufferByteOrderDirectRW() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | ByteBufferScalarVersusVectorBenchmark.java | 20 import java.nio.ByteBuffer; 28 ByteBuffer src = ByteBufferBenchmark.newBuffer(byteOrder, aligned, bufferType); in timeManualByteBufferCopy() 29 ByteBuffer dst = ByteBufferBenchmark.newBuffer(byteOrder, aligned, bufferType); in timeManualByteBufferCopy() 40 ByteBuffer src = ByteBuffer.allocate(aligned ? 8192 : 8192 + 1); in timeByteBufferBulkGet() 49 ByteBuffer src = ByteBuffer.allocateDirect(aligned ? 8192 : 8192 + 1); in timeDirectByteBufferBulkGet()
|