Home
last modified time | relevance | path

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

12345678910>>...14

/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 …]
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 …]
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 …]
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 …]
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 …]
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/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/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/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 …]
/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 …]
DOldPushbackInputStreamTest.java126 byte[] buf = ("01234567890123456789").getBytes(); in test_read$BII()
129 tobj.read(buf, 6, 5); in test_read$BII()
130 assertEquals("Wrong value read!", "BEGIN", new String(buf, 6, 5)); in test_read$BII()
131 assertEquals("Too much read!", "012345BEGIN123456789", new String(buf)); in test_read$BII()
134 tobj.read(buf, 6, 5); in test_read$BII()
143 byte[] buf = new byte[10]; in test_read$BII_Exception()
147 tobj.read(buf, -1, 1); in test_read$BII_Exception()
153 tobj.read(buf, 0, -1); in test_read$BII_Exception()
159 tobj.read(buf, 10, 1); in test_read$BII_Exception()
168 byte[] buf = ("01234567890123456789").getBytes(); in test_skipJ()
[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()
104 if (newcount > buf.length) { in write()
105 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); in write()
107 System.arraycopy(c, off, buf, count, len); in write()
121 if (newcount > buf.length) { in write()
122 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount)); in write()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DGZIPOutputStream.java142 public synchronized void write(byte[] buf, int off, int len) in write() argument
145 super.write(buf, off, len); in write()
146 crc.update(buf, off, len); in write()
159 int len = def.deflate(buf, 0, buf.length); in finish()
160 if (def.finished() && len <= buf.length - TRAILER_SIZE) { in finish()
162 writeTrailer(buf, len); in finish()
164 out.write(buf, 0, len); in finish()
168 out.write(buf, 0, len); in finish()
200 private void writeTrailer(byte[] buf, int offset) throws IOException { in writeTrailer() argument
201 writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data in writeTrailer() local
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestPadPrinterDecorator.java78 getFormatter().formatTo(EMPTY_DTA, buf); in test_print_emptyCalendrical()
79 assertEquals(buf.toString(), "--Z"); in test_print_emptyCalendrical()
84 getFormatter().formatTo(LocalDate.of(2008, 12, 3), buf); in test_print_fullDateTime()
85 assertEquals(buf.toString(), "--Z"); in test_print_fullDateTime()
89 buf.append("EXISTING"); in test_print_append()
91 getFormatter().formatTo(EMPTY_DTA, buf); in test_print_append()
92 assertEquals(buf.toString(), "EXISTING--Z"); in test_print_append()
98 getFormatter().formatTo(EMPTY_DTA, buf); in test_print_noPadRequiredSingle()
99 assertEquals(buf.toString(), "Z"); in test_print_noPadRequiredSingle()
104 getFormatter().formatTo(EMPTY_DTA, buf); in test_print_padRequiredSingle()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DPushbackInputStreamTest.java147 byte[] buf = new byte[100]; in test_read$BII()
148 pis.read(buf, 0, buf.length); in test_read$BII()
149 assertTrue("Incorrect bytes read", new String(buf, "UTF-8") in test_read$BII()
161 byte[] buf = new byte[50]; in test_skipJ()
163 pis.read(buf, 0, buf.length); in test_skipJ()
164 assertTrue("a) Incorrect bytes read", new String(buf, "UTF-8") in test_skipJ()
166 pis.unread(buf); in test_skipJ()
180 byte[] buf = new byte[100]; in test_unread$B()
181 pis.read(buf, 0, buf.length); in test_unread$B()
182 assertTrue("Incorrect bytes read", new String(buf, "UTF-8") in test_unread$B()
[all …]
/libcore/dom/src/test/java/org/w3c/domts/
DDOMTestIncompatibleException.java52 StringBuffer buf = new StringBuffer( in incompatibleFeature() local
54 buf.append(feature); in incompatibleFeature()
55 buf.append("\" version=\""); in incompatibleFeature()
56 buf.append(version); in incompatibleFeature()
57 buf.append("\"."); in incompatibleFeature()
58 return new DOMTestIncompatibleException(buf.toString()); in incompatibleFeature()
63 StringBuffer buf = new StringBuffer( in incompatibleLoad() local
65 buf.append(href); in incompatibleLoad()
66 buf.append("\" not available for =\""); in incompatibleLoad()
67 buf.append(contentType); in incompatibleLoad()
[all …]

12345678910>>...14