Searched refs:ByteBuffer (Results 1 - 25 of 142) sorted by relevance

123456

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
H A DASCCharsetDecoderTest.java20 import java.nio.ByteBuffer;
45 ByteBuffer getUnmappedByteBuffer() {
48 // ByteBuffer buffer = ByteBuffer.allocate(8);
56 ByteBuffer getMalformedByteBuffer() {
58 ByteBuffer buffer = ByteBuffer.allocate(8);
68 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
H A DGBCharsetDecoderTest.java20 import java.nio.ByteBuffer;
48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
52 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
53 ByteBuffer buffer = ByteBuffer.allocate(20);
60 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
H A DUTF16BECharsetDecoderTest.java20 import java.nio.ByteBuffer;
48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
53 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
55 // ByteBuffer buffer = ByteBuffer.allocate(100);
64 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
68 protected ByteBuffer getByteBuffer() {
69 return ByteBuffer.wrap(new byte[] { 0, 32, 0, 98, 0, 117, 0, 102, 0,
H A DUTF16LECharsetDecoderTest.java20 import java.nio.ByteBuffer;
48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
53 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
55 // ByteBuffer buffer = ByteBuffer.allocate(100);
64 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
68 protected ByteBuffer getByteBuffer() {
69 return ByteBuffer.wrap(new byte[] { 32, 0, 98, 0, 117, 0, 102, 0, 102,
H A DUTFCharsetDecoderTest.java20 import java.nio.ByteBuffer;
48 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
52 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
53 ByteBuffer buffer = ByteBuffer.allocate(getByteBuffer().remaining() + 1);
60 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
68 protected ByteBuffer getByteBuffer() {
69 return ByteBuffer.wrap(new byte[] { 32, 98, 117, 102, 102, 101, 114,
H A DISOCharsetDecoderTest.java20 import java.nio.ByteBuffer;
46 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
52 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
57 ByteBuffer getExceptionByteArray() throws UnsupportedEncodingException {
H A DUTF16CharsetDecoderTest.java20 import java.nio.ByteBuffer;
47 protected ByteBuffer getByteBuffer() {
58 return ByteBuffer.wrap(b);
61 protected ByteBuffer getHeadlessByteBuffer() {
62 ByteBuffer b = getByteBuffer();
66 return ByteBuffer.wrap(bytes);
98 ByteBuffer getUnmappedByteBuffer() throws UnsupportedEncodingException {
102 ByteBuffer getMalformedByteBuffer() throws UnsupportedEncodingException {
105 // ByteBuffer buffer = ByteBuffer
[all...]
H A DASCIICharsetEncoderTest.java20 import java.nio.ByteBuffer;
85 ByteBuffer out = ByteBuffer.allocate(10);
91 out = ByteBuffer.allocate(10);
109 ByteBuffer bb = encoder.encode(cb);
127 ByteBuffer bb = ByteBuffer.allocate(0x10);
140 ByteBuffer out = ByteBuffer.allocate(0x10);
162 ByteBuffer ou
[all...]
/libcore/luni/src/main/java/java/nio/channels/
H A DReadableByteChannel.java20 import java.nio.ByteBuffer;
65 public int read(ByteBuffer buffer) throws IOException;
H A DWritableByteChannel.java20 import java.nio.ByteBuffer;
63 public int write(ByteBuffer buffer) throws IOException;
H A DGatheringByteChannel.java20 import java.nio.ByteBuffer;
56 public long write(ByteBuffer[] buffers) throws IOException;
93 public long write(ByteBuffer[] buffers, int offset, int length)
H A DScatteringByteChannel.java20 import java.nio.ByteBuffer;
52 public long read(ByteBuffer[] buffers) throws IOException;
88 public long read(ByteBuffer[] buffers, int offset, int length)
H A DDatagramChannel.java25 import java.nio.ByteBuffer;
181 public abstract SocketAddress receive(ByteBuffer target) throws IOException;
219 public abstract int send(ByteBuffer source, SocketAddress address) throws IOException;
231 * @see java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)
250 public abstract int read(ByteBuffer target) throws IOException;
262 * @see java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[],
290 public abstract long read(ByteBuffer[] targets, int offset, int length)
303 * @see java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[])
322 public synchronized final long read(ByteBuffer[] targets)
335 * @see java.nio.channels.WritableByteChannel#write(java.nio.ByteBuffer)
[all...]
H A DSocketChannel.java23 import java.nio.ByteBuffer;
262 * @see java.nio.channels.ReadableByteChannel#read(java.nio.ByteBuffer)
264 public abstract int read(ByteBuffer target) throws IOException;
298 * @see java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[],
301 public abstract long read(ByteBuffer[] targets, int offset, int length) throws IOException;
332 public synchronized final long read(ByteBuffer[] targets) throws IOException {
363 * @see java.nio.channels.WritableByteChannel#write(java.nio.ByteBuffer)
365 public abstract int write(ByteBuffer source) throws IOException;
401 * @see java.nio.channels.GatheringByteChannel#write(java.nio.ByteBuffer[],
404 public abstract long write(ByteBuffer[] source
[all...]
H A DFileChannel.java20 import java.nio.ByteBuffer;
343 public abstract int read(ByteBuffer buffer) throws IOException;
380 public abstract int read(ByteBuffer buffer, long position)
414 public final long read(ByteBuffer[] buffers) throws IOException {
453 public abstract long read(ByteBuffer[] buffers, int start, int number)
642 * @see java.nio.channels.WritableByteChannel#write(java.nio.ByteBuffer)
644 public abstract int write(ByteBuffer src) throws IOException;
681 public abstract int write(ByteBuffer buffer, long position)
713 public final long write(ByteBuffer[] buffers) throws IOException {
754 public abstract long write(ByteBuffer[] buffer
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
H A DSSLEngineTest.java21 import java.nio.ByteBuffer;
304 * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
312 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,1,2,3,1,2,3,1,2,31,2,3,1,2,3,1,2,3,1,2,3});
313 ByteBuffer bbd = ByteBuffer.allocate(100);
315 clientEngine.engine.unwrap(bbs, new ByteBuffer[] { bbd }, 0, 1);
322 * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dst
[all...]
/libcore/luni/src/test/java/libcore/java/nio/
H A DNoArrayTest.java19 import java.nio.ByteBuffer;
26 assertNoArray(ByteBuffer.wrap(new byte[32]).asReadOnlyBuffer());
27 assertNoArray(ByteBuffer.allocate(32).asReadOnlyBuffer());
28 assertNoArray(ByteBuffer.allocateDirect(32).asReadOnlyBuffer());
31 private void assertNoArray(ByteBuffer buf) {
/libcore/luni/src/main/java/java/nio/
H A DByteBuffer.java37 public abstract class ByteBuffer extends Buffer implements Comparable<ByteBuffer> { class in inherits:Buffer,Comparable
52 public static ByteBuffer allocate(int capacity) {
68 public static ByteBuffer allocateDirect(int capacity) {
89 public static ByteBuffer wrap(byte[] array) {
111 public static ByteBuffer wrap(byte[] array, int start, int byteCount) {
113 ByteBuffer buf = new ByteArrayBuffer(array);
119 ByteBuffer(int capacity, long effectiveDirectAddress) { method in class:ByteBuffer
241 public abstract ByteBuffer asReadOnlyBuffer();
270 public abstract ByteBuffer compac
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
H A DWrappedByteBufferTest.java19 import java.nio.ByteBuffer;
25 buf = ByteBuffer.wrap(new byte[BUFFER_LENGTH]);
36 * @tests java.nio.ByteBuffer#allocate(byte[],int,int)
42 ByteBuffer.wrap(array, -1, 0);
48 ByteBuffer.wrap(array, BUFFER_LENGTH + 1, 0);
54 ByteBuffer.wrap(array, 0, -1);
60 ByteBuffer.wrap(array, 0, BUFFER_LENGTH + 1);
66 ByteBuffer.wrap(array, 1, Integer.MAX_VALUE);
72 ByteBuffer.wrap(array, Integer.MAX_VALUE, 1);
78 ByteBuffer
[all...]
/libcore/luni/src/main/java/javax/net/ssl/
H A DSSLEngine.java20 import java.nio.ByteBuffer;
956 public abstract SSLEngineResult unwrap(ByteBuffer src,
957 ByteBuffer[] dsts,
990 public abstract SSLEngineResult wrap(ByteBuffer[] srcs, int offset, int length, ByteBuffer dst)
1013 public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer dst) throws SSLException {
1014 return unwrap(src, new ByteBuffer[] { dst }, 0, 1);
1038 public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dst
[all...]
/libcore/luni/src/test/java/libcore/java/nio/channels/
H A DPipeTest.java19 import java.nio.ByteBuffer;
26 assertEquals(0, p.source().read(ByteBuffer.allocate(1)));
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
H A DSourceChannelTest.java20 import java.nio.ByteBuffer;
42 private ByteBuffer buffer;
44 private ByteBuffer positionedBuffer;
51 buffer = ByteBuffer.wrap("bytes".getBytes(ISO8859_1));
52 positionedBuffer = ByteBuffer.wrap("12345bytes".getBytes(ISO8859_1));
64 * @tests java.nio.channels.Pipe.SourceChannel#read(ByteBuffer)
68 sink.write(ByteBuffer.allocate(1));
69 int count = source.read(ByteBuffer.allocate(10));
74 * @tests java.nio.channels.Pipe.SourceChannel#read(ByteBuffer)
77 ByteBuffer nullBu
[all...]
H A DMockSocketChannel.java23 import java.nio.ByteBuffer;
59 public int read(ByteBuffer arg0) throws IOException {
64 public long read(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
69 public int write(ByteBuffer arg0) throws IOException {
74 public long write(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
H A DMockDatagramChannel.java23 import java.nio.ByteBuffer;
54 public SocketAddress receive(ByteBuffer arg0) throws IOException {
59 public int send(ByteBuffer arg0, SocketAddress arg1) throws IOException {
64 public int read(ByteBuffer arg0) throws IOException {
69 public long read(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
74 public int write(ByteBuffer arg0) throws IOException {
79 public long write(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
/libcore/luni/src/test/java/libcore/java/nio/charset/
H A DOldCharsetEncoderDecoderBufferTest.java19 import java.nio.ByteBuffer;
43 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'a', (byte)'b', (byte)'c', (byte)'d'}),
51 out = ByteBuffer.wrap(bBuf).asCharBuffer();
53 decoder.decode(ByteBuffer.wrap(new byte[]{(byte)'x'}), out, true);
74 ByteBuffer inWithArray = ByteBuffer.wrap(inArray);
80 // A read-only ByteBuffer must not expose its array.
81 ByteBuffer inWithoutArray = ByteBuffer.wrap(new byte[] { (byte) 'x' }).asReadOnlyBuffer();
99 ByteBuffer ou
[all...]

Completed in 504 milliseconds

123456