Home
last modified time | relevance | path

Searched refs:ByteBuffer (Results 1 – 25 of 208) sorted by relevance

123456789

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineTest.java21 import java.nio.ByteBuffer;
325ByteBuffer 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()
326ByteBuffer 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()
342ByteBuffer[] 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()
400ByteBuffer[] bbA = {ByteBuffer.allocate(100), ByteBuffer.allocate(10), ByteBuffer.allocate(100)}; in test_unwrap_04()
[all …]
/libcore/ojluni/annotations/mmodule/java/nio/
DByteBuffer.annotated.java34 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 …]
DDirectByteBuffer.annotated.java42 public final java.nio.ByteBuffer slice() { throw new RuntimeException("Stub!"); } in slice()
44 public final java.nio.ByteBuffer duplicate() { throw new RuntimeException("Stub!"); } in duplicate()
46 public final java.nio.ByteBuffer asReadOnlyBuffer() { throw new RuntimeException("Stub!"); } in asReadOnlyBuffer()
55 public java.nio.ByteBuffer get(byte[] dst, int dstOffset, int length) { throw new RuntimeException(… in get()
57 public java.nio.ByteBuffer put(java.nio.ByteBuffer src) { throw new RuntimeException("Stub!"); } in put()
59 public final java.nio.ByteBuffer put(byte x) { throw new RuntimeException("Stub!"); } in put()
61 public final java.nio.ByteBuffer put(int i, byte x) { throw new RuntimeException("Stub!"); } in put()
63 public java.nio.ByteBuffer put(byte[] src, int srcOffset, int length) { throw new RuntimeException(… in put()
65 public final java.nio.ByteBuffer compact() { throw new RuntimeException("Stub!"); } in compact()
75 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/
DSourceChannelTest.java20 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 …]
DDatagramChannelTest.java29 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 …]
DSinkChannelTest.java22 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 …]
DFileChannelTest.java29 import java.nio.ByteBuffer;
181 ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES); in test_forceJ()
234 ByteBuffer readBuffer = ByteBuffer.allocate(CONTENT_LENGTH); in test_position_ReadOnly()
281 ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES); in test_position_WriteOnly()
293 ByteBuffer readBuffer = ByteBuffer.allocate(CONTENT_LENGTH); in test_position_ReadWrite()
297 ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES); in test_position_ReadWrite()
394 ByteBuffer readBuffer = ByteBuffer.allocate(CONTENT_LENGTH); in test_positionJ_ReadOnly()
414 ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES); in test_positionJ_WriteOnly()
464 ByteBuffer buf = ByteBuffer.allocate(8); in test_size()
466 ByteBuffer[] bufs = { ByteBuffer.allocate(8) }; in test_size()
[all …]
DSocketChannelTest.java33 import java.nio.ByteBuffer;
130 java.nio.ByteBuffer[] buf = new java.nio.ByteBuffer[1]; in testOpen()
131 buf[0] = java.nio.ByteBuffer.allocateDirect(CAPACITY_NORMAL); in testOpen()
230 java.nio.ByteBuffer[] byteBuf = null; in testReadByteBufferArray()
242 byteBuf = new java.nio.ByteBuffer[CAPACITY_NORMAL]; in testReadByteBufferArray()
263 java.nio.ByteBuffer[] byteBuf = null; in testReadByteBufferArray_BufNull()
291 java.nio.ByteBuffer[] byteBuf = null; in testWriteByteBufferArray()
301 byteBuf = new java.nio.ByteBuffer[CAPACITY_NORMAL]; in testWriteByteBufferArray()
316 java.nio.ByteBuffer[] byteBuf = null; in testWriteByteBufferArray_BufNull()
1598 java.nio.ByteBuffer writeBuf = java.nio.ByteBuffer in testCFII_Data_ConnectWithServer()
[all …]
/libcore/ojluni/annotations/hiddenapi/java/nio/
DByteBuffer.java34 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 …]
DDirectByteBuffer.java87 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/
DASCIICharsetEncoderTest.java20 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 …]
DUTFCharsetDecoderTest.java20 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()
DUTF16CharsetDecoderTest.java20 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()
DUTF16LECharsetDecoderTest.java20 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()
DUTF16BECharsetDecoderTest.java20 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()
DASCCharsetDecoderTest.java20 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()
/libcore/ojluni/src/main/java/java/nio/
DByteBuffer.java207 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/annotations/sdk/nullability/java/nio/
DByteBuffer.annotated.java31 public abstract class ByteBuffer extends java.nio.Buffer implements java.lang.Comparable<java.nio.B… class
33 ByteBuffer(int mark, int pos, int lim, int cap) { super(0, 0, 0, 0, 0); throw new RuntimeException(… in ByteBuffer() method in ByteBuffer
35 @libcore.util.NonNull public static java.nio.ByteBuffer allocateDirect(int capacity) { throw new Ru… in allocateDirect()
37 @libcore.util.NonNull public static java.nio.ByteBuffer allocate(int capacity) { throw new RuntimeE… in allocate()
39 @libcore.util.NonNull public static java.nio.ByteBuffer wrap(byte @libcore.util.NonNull [] array, i… in wrap()
41 @libcore.util.NonNull public static java.nio.ByteBuffer wrap(byte @libcore.util.NonNull [] array) {… in wrap()
43 @libcore.util.NonNull public abstract java.nio.ByteBuffer slice(); in slice()
45 @libcore.util.NonNull public abstract java.nio.ByteBuffer duplicate(); in duplicate()
47 @libcore.util.NonNull public abstract java.nio.ByteBuffer asReadOnlyBuffer(); in asReadOnlyBuffer()
51 @libcore.util.NonNull public abstract java.nio.ByteBuffer put(byte b); in put()
[all …]
/libcore/ojluni/src/main/java/javax/net/ssl/
DSSLEngine.java28 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/ojluni/src/main/java/sun/nio/ch/
DUtil.java29 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DWrappedByteBufferTest.java19 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/luni/src/test/java/libcore/java/nio/charset/
DOldCharsetEncoderDecoderBufferTest.java19 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/
DOldFileChannelTest.java26 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/luni/src/test/java/libcore/java/nio/
DBufferTest.java29 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/ojluni/src/main/java/java/nio/channels/
DDatagramChannel.java33 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()

123456789