Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 358) sorted by relevance

12345678910>>...15

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DFloatBufferTest.java37 protected FloatBuffer buf; field in FloatBufferTest
40 buf = FloatBuffer.allocate(BUFFER_LENGTH); in setUp()
41 loadTestData1(buf); in setUp()
42 baseBuf = buf; in setUp()
46 buf = null; in tearDown()
51 float array[] = buf.array(); in testArray()
52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DLongBufferTest.java37 protected LongBuffer buf; field in LongBufferTest
40 buf = LongBuffer.allocate(BUFFER_LENGTH); in setUp()
41 loadTestData1(buf); in setUp()
42 baseBuf = buf; in setUp()
46 buf = null; in tearDown()
51 long array[] = buf.array(); in testArray()
52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DIntBufferTest.java37 protected IntBuffer buf; field in IntBufferTest
40 buf = IntBuffer.allocate(BUFFER_LENGTH); in setUp()
41 loadTestData1(buf); in setUp()
42 baseBuf = buf; in setUp()
46 buf = null; in tearDown()
51 int array[] = buf.array(); in testArray()
52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DShortBufferTest.java36 protected ShortBuffer buf; field in ShortBufferTest
39 buf = ShortBuffer.allocate(BUFFER_LENGTH); in setUp()
40 loadTestData1(buf); in setUp()
41 baseBuf = buf; in setUp()
45 buf = null; in tearDown()
50 short array[] = buf.array(); in testArray()
51 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
53 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
54 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
56 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DDoubleBufferTest.java36 protected DoubleBuffer buf; field in DoubleBufferTest
39 buf = DoubleBuffer.allocate(BUFFER_LENGTH); in setUp()
40 loadTestData1(buf); in setUp()
41 baseBuf = buf; in setUp()
45 buf = null; in tearDown()
75 double array[] = buf.array(); in testArray()
76 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
78 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
79 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
81 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DCharBufferTest.java37 protected CharBuffer buf; field in CharBufferTest
44 buf = CharBuffer.wrap(charscopy); in setUp()
45 baseBuf = buf; in setUp()
49 buf = null; in tearDown()
54 char array[] = buf.array(); in testArray()
55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
57 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
60 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DByteBufferTest.java46 protected ByteBuffer buf; field in ByteBufferTest
49 buf = ByteBuffer.allocate(10); in setUp()
50 loadTestData1(buf); in setUp()
51 baseBuf = buf; in setUp()
85 if (buf.hasArray()) { in testArray()
86 byte array[] = buf.array(); in testArray()
87 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
89 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
90 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
92 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
[all …]
DReadOnlyCharBufferTest.java25 loadTestData1(buf); in setUp()
26 buf = buf.asReadOnlyBuffer(); in setUp()
27 baseBuf = buf; in setUp()
31 buf = null; in tearDown()
37 assertTrue(buf.isReadOnly()); in testIsReadOnly()
41 assertFalse(buf.hasArray()); in testHasArray()
46 buf.array(); in testArray()
53 CharBuffer duplicate = buf.duplicate(); in testHashCode()
54 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
59 buf.arrayOffset(); in testArrayOffset()
[all …]
DReadOnlyShortBufferTest.java24 buf = buf.asReadOnlyBuffer(); in setUp()
25 baseBuf = buf; in setUp()
33 assertTrue(buf.isReadOnly()); in testIsReadOnly()
37 assertFalse(buf.hasArray()); in testHasArray()
42 buf.array(); in testArray()
50 ShortBuffer duplicate = buf.duplicate(); in testHashCode()
51 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
56 buf.arrayOffset(); in testArrayOffset()
65 buf.compact(); in testCompact()
74 buf.put((short)0); in testPutshort()
[all …]
DReadOnlyIntBufferTest.java24 buf = buf.asReadOnlyBuffer(); in setUp()
25 baseBuf = buf; in setUp()
33 assertTrue(buf.isReadOnly()); in testIsReadOnly()
37 assertFalse(buf.hasArray()); in testHasArray()
42 buf.array(); in testArray()
50 IntBuffer duplicate = buf.duplicate(); in testHashCode()
51 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
56 buf.arrayOffset(); in testArrayOffset()
65 buf.compact(); in testCompact()
74 buf.put(0); in testPutint()
[all …]
DReadOnlyLongBufferTest.java24 buf = buf.asReadOnlyBuffer(); in setUp()
25 baseBuf = buf; in setUp()
33 assertTrue(buf.isReadOnly()); in testIsReadOnly()
37 assertFalse(buf.hasArray()); in testHasArray()
42 buf.array(); in testArray()
50 LongBuffer duplicate = buf.duplicate(); in testHashCode()
51 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
56 buf.arrayOffset(); in testArrayOffset()
65 buf.compact(); in testCompact()
74 buf.put(0); in testPutlong()
[all …]
DReadOnlyDoubleBufferTest.java25 buf = buf.asReadOnlyBuffer(); in setUp()
26 baseBuf = buf; in setUp()
34 assertTrue(buf.isReadOnly()); in testIsReadOnly()
38 assertFalse(buf.hasArray()); in testHasArray()
43 buf.array(); in testArray()
50 DoubleBuffer duplicate = buf.duplicate(); in testHashCode()
51 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
56 buf.arrayOffset(); in testArrayOffset()
64 buf.compact(); in testCompact()
73 buf.put(0); in testPutdouble()
[all …]
DReadOnlyFloatBufferTest.java24 buf = buf.asReadOnlyBuffer(); in setUp()
25 baseBuf = buf; in setUp()
33 assertTrue(buf.isReadOnly()); in testIsReadOnly()
37 assertFalse(buf.hasArray()); in testHasArray()
42 buf.array(); in testArray()
50 FloatBuffer duplicate = buf.duplicate(); in testHashCode()
51 assertEquals(buf.hashCode(), duplicate.hashCode()); in testHashCode()
56 buf.arrayOffset(); in testArrayOffset()
65 buf.compact(); in testCompact()
74 buf.put(0); in testPutfloat()
[all …]
DDirectByteBufferTest.java28 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*Byte.BYTES); in setUp()
29 baseBuf = buf; in setUp()
34 buf = null; in tearDown()
51 assertTrue(buf.isDirect()); in testIsDirect()
56 assertTrue(buf.hasArray()); in testHasArray()
61 assertFalse(buf.isReadOnly()); in testIsReadOnly()
68 ByteBuffer buf = ByteBuffer.allocateDirect(23); in testUnalignedReadsAndWrites() local
70 buf.order(ByteOrder.BIG_ENDIAN); in testUnalignedReadsAndWrites()
73 buf.position(i); in testUnalignedReadsAndWrites()
76 ShortBuffer shortBuf = buf.asShortBuffer(); in testUnalignedReadsAndWrites()
[all …]
/libcore/ojluni/src/test/java/nio/Buffer/
DOrderChar.java37 private static void ckCharBuffer(CharBuffer buf, ByteOrder expected) { in ckCharBuffer() argument
38 ck(buf.asReadOnlyBuffer().order(), expected); in ckCharBuffer()
39 ck(buf.duplicate().order(), expected); in ckCharBuffer()
40 ck(buf.slice().order(), expected); in ckCharBuffer()
42 ck(buf.subSequence(buf.position(), buf.remaining()).order(), expected); in ckCharBuffer()
43 ck(buf.subSequence(buf.position(), buf.position()).order(), expected); in ckCharBuffer()
49 CharBuffer buf = CharBuffer.wrap(array); in ckCharBuffer() local
50 ck(buf.order(), nord); in ckCharBuffer()
51 ckCharBuffer(buf, nord); in ckCharBuffer()
53 buf = CharBuffer.wrap(array, LENGTH/2, LENGTH/2); in ckCharBuffer()
[all …]
DOrder-X.java.template37 private static void ck$Type$Buffer($Type$Buffer buf, ByteOrder expected) {
38 ck(buf.asReadOnlyBuffer().order(), expected);
39 ck(buf.duplicate().order(), expected);
40 ck(buf.slice().order(), expected);
42 ck(buf.subSequence(buf.position(), buf.remaining()).order(), expected);
43 ck(buf.subSequence(buf.position(), buf.position()).order(), expected);
49 $Type$Buffer buf = $Type$Buffer.wrap(array);
50 ck(buf.order(), nord);
51 ck$Type$Buffer(buf, nord);
53 buf = $Type$Buffer.wrap(array, LENGTH/2, LENGTH/2);
[all …]
DOrderLong.java37 private static void ckLongBuffer(LongBuffer buf, ByteOrder expected) { in ckLongBuffer() argument
38 ck(buf.asReadOnlyBuffer().order(), expected); in ckLongBuffer()
39 ck(buf.duplicate().order(), expected); in ckLongBuffer()
40 ck(buf.slice().order(), expected); in ckLongBuffer()
49 LongBuffer buf = LongBuffer.wrap(array); in ckLongBuffer() local
50 ck(buf.order(), nord); in ckLongBuffer()
51 ckLongBuffer(buf, nord); in ckLongBuffer()
53 buf = LongBuffer.wrap(array, LENGTH/2, LENGTH/2); in ckLongBuffer()
54 ck(buf.order(), nord); in ckLongBuffer()
55 ckLongBuffer(buf, nord); in ckLongBuffer()
[all …]
DOrderFloat.java37 private static void ckFloatBuffer(FloatBuffer buf, ByteOrder expected) { in ckFloatBuffer() argument
38 ck(buf.asReadOnlyBuffer().order(), expected); in ckFloatBuffer()
39 ck(buf.duplicate().order(), expected); in ckFloatBuffer()
40 ck(buf.slice().order(), expected); in ckFloatBuffer()
49 FloatBuffer buf = FloatBuffer.wrap(array); in ckFloatBuffer() local
50 ck(buf.order(), nord); in ckFloatBuffer()
51 ckFloatBuffer(buf, nord); in ckFloatBuffer()
53 buf = FloatBuffer.wrap(array, LENGTH/2, LENGTH/2); in ckFloatBuffer()
54 ck(buf.order(), nord); in ckFloatBuffer()
55 ckFloatBuffer(buf, nord); in ckFloatBuffer()
[all …]
/libcore/ojluni/src/main/java/java/net/
DDatagramPacket.java67 byte[] buf; field in DatagramPacket
87 public DatagramPacket(byte buf[], int offset, int length) { in DatagramPacket() argument
88 setData(buf, offset, length); in DatagramPacket()
103 public DatagramPacket(byte buf[], int length) { in DatagramPacket() argument
104 this (buf, 0, length); in DatagramPacket()
123 public DatagramPacket(byte buf[], int offset, int length, in DatagramPacket() argument
125 setData(buf, offset, length); in DatagramPacket()
152 public DatagramPacket(byte buf[], int offset, int length, SocketAddress address) { in DatagramPacket() argument
153 setData(buf, offset, length); in DatagramPacket()
175 public DatagramPacket(byte buf[], int length, in DatagramPacket() argument
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DDerInputBuffer.java47 DerInputBuffer(byte[] buf) { super(buf); } in DerInputBuffer() argument
49 DerInputBuffer(byte[] buf, int offset, int len) { in DerInputBuffer() argument
50 super(buf, offset, len); in DerInputBuffer()
70 System.arraycopy(buf, pos, retval, 0, len); in toByteArray()
81 System.arraycopy(buf, startPos, result, 0, size); in getSlice()
90 return buf[pos]; in peek()
112 if (this.buf[this.pos + i] != other.buf[other.pos + i]) { in equals()
131 retval += buf[p + i] * i; in hashCode()
159 System.arraycopy(buf, pos, bytes, 0, len); in getBigInteger()
207 int numOfPadBits = buf[pos]; in getBitString()
[all …]
/libcore/ojluni/src/test/java/io/PrintStream/
DWriteBytes.java49 byte[] buf = new byte[128]; in testWriteBytes()
50 for (int i = 0; i < buf.length; i++) { in testWriteBytes()
51 buf[i] = (byte)i; in testWriteBytes()
54 ps.writeBytes(buf); in testWriteBytes()
57 assertEquals(baos.size(), buf.length, "Stream size " + baos.size() + in testWriteBytes()
58 " but expected " + buf.length); in testWriteBytes()
61 ps.writeBytes(buf); in testWriteBytes()
62 assertEquals(baos.size(), 2*buf.length, "Stream size " + baos.size() + in testWriteBytes()
63 " but expected " + 2*buf.length); in testWriteBytes()
66 assertEquals(arr.length, 2*buf.length, "Array length " + arr.length + in testWriteBytes()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DUtil.java100 private static boolean isBufferTooLarge(ByteBuffer buf) { in isBufferTooLarge() argument
101 return isBufferTooLarge(buf.capacity()); in isBufferTooLarge()
139 ByteBuffer buf = buffers[start]; in get() local
140 if (buf.capacity() < size) { in get()
141 buf = null; in get()
148 buf = bb; in get()
152 if (buf == null) in get()
164 buf.rewind(); in get()
165 buf.limit(size); in get()
166 return buf; in get()
[all …]
/libcore/ojluni/src/main/java/java/io/
DCharArrayWriter.java47 protected char buf[]; field in CharArrayWriter
72 buf = new char[initialSize]; in CharArrayWriter()
81 if (newcount > buf.length) { in write()
82 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); in write()
84 buf[count] = (char)c; in write()
109 if (newcount > buf.length) { in write()
110 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); in write()
112 System.arraycopy(c, off, buf, count, len); in write()
131 if (newcount > buf.length) { in write()
132 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); in write()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldReaderTest.java36 CharBuffer buf = CharBuffer.allocate(4); in test_Reader_CharBufferChar() local
37 assertEquals("Wrong return value!", 4, simple.read(buf)); in test_Reader_CharBufferChar()
38 buf.rewind(); in test_Reader_CharBufferChar()
39 assertEquals("Wrong stuff read!", "Bla ", String.valueOf(buf)); in test_Reader_CharBufferChar()
40 simple.read(buf); in test_Reader_CharBufferChar()
41 buf.rewind(); in test_Reader_CharBufferChar()
42 assertEquals("Wrong stuff read!", "bla,", String.valueOf(buf)); in test_Reader_CharBufferChar()
45 simple.read(buf); in test_Reader_CharBufferChar()
54 char[] buf = new char[4]; in test_Read_$C() local
55 assertEquals("Wrong return value!", 4, simple.read(buf)); in test_Read_$C()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_StringWriter.java24 private StringBuffer buf; field in Support_StringWriter
33 buf = new StringBuffer(16); in Support_StringWriter()
34 lock = buf; in Support_StringWriter()
44 buf = new StringBuffer(initialSize); in Support_StringWriter()
45 lock = buf; in Support_StringWriter()
80 return buf; in getBuffer()
94 return buf.toString(); in toString()
113 public void write(char[] buf, int offset, int count) { in write() argument
115 if (0 <= offset && offset <= buf.length && 0 <= count in write()
116 && count <= buf.length - offset) { in write()
[all …]

12345678910>>...15