Home
last modified time | relevance | path

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

1234567891011

/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 …]
DByteBufferTest.java42 protected ByteBuffer buf; field in ByteBufferTest
45 buf = ByteBuffer.allocate(10); in setUp()
46 loadTestData1(buf); in setUp()
47 baseBuf = buf; in setUp()
55 if (buf.hasArray()) { in testArray()
56 byte array[] = buf.array(); in testArray()
57 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
59 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
60 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
62 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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
/libcore/luni/src/main/java/java/lang/
DIntegralToString.java146 char[] buf = new char[bufLen]; in intToString()
151 buf[--cursor] = DIGITS[radix * q - i]; in intToString()
156 buf[--cursor] = '-'; in intToString()
159 return new String(cursor, bufLen - cursor, buf); in intToString()
216 char[] buf = (sb != null) ? BUFFER.get() : new char[bufLen];
224 buf[--cursor] = ONES[r];
225 buf[--cursor] = TENS[r];
234 buf[--cursor] = DIGITS[r];
239 buf[--cursor] = '-';
243 sb.append0(buf, cursor, bufLen - cursor);
[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/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 …]
/libcore/luni/src/main/java/java/io/
DPushbackInputStream.java33 protected byte[] buf; field in PushbackInputStream
56 buf = (in == null) ? null : new byte[1]; in PushbackInputStream()
80 buf = (in == null) ? null : new byte[size]; in PushbackInputStream()
86 if (buf == null) { in available()
89 return buf.length - pos + in.available(); in available()
104 buf = null; in close()
137 if (buf == null) { in read()
141 if (pos < buf.length) { in read()
142 return (buf[pos++] & 0xFF); in read()
167 if (buf == null) { in read()
[all …]
DBufferedWriter.java43 private char[] buf; field in BufferedWriter
71 this.buf = new char[size]; in BufferedWriter()
95 buf = null; in close()
139 out.write(buf, 0, pos); in flushInternal()
191 if (pos == 0 && count >= this.buf.length) { in write()
195 int available = this.buf.length - pos; in write()
200 System.arraycopy(buffer, offset, this.buf, pos, available); in write()
203 if (pos == this.buf.length) { in write()
204 out.write(this.buf, 0, this.buf.length); in write()
209 if (available >= this.buf.length) { in write()
[all …]
DByteArrayOutputStream.java34 protected byte[] buf; field in ByteArrayOutputStream
47 buf = new byte[32]; in ByteArrayOutputStream()
63 buf = new byte[size]; in ByteArrayOutputStream()
87 if (count + i <= buf.length) { in expand()
92 System.arraycopy(buf, 0, newbuf, 0, count); in expand()
93 buf = newbuf; in expand()
123 System.arraycopy(buf, 0, newArray, 0, count); in toByteArray()
137 return new String(buf, 0, count); in toString()
158 newBuf[i] = (char) (((hibyte & 0xff) << 8) | (buf[i] & 0xff)); in toString()
175 return new String(buf, 0, count, charsetName); in toString()
[all …]
DCharArrayReader.java31 protected char[] buf; field in CharArrayReader
56 public CharArrayReader(char[] buf) { in CharArrayReader() argument
57 this.buf = buf; in CharArrayReader()
58 this.count = buf.length; in CharArrayReader()
76 public CharArrayReader(char[] buf, int offset, int length) { in CharArrayReader() argument
83 if (offset < 0 || offset > buf.length || length < 0 || offset + length < 0) { in CharArrayReader()
86 this.buf = buf; in CharArrayReader()
91 int bufferLength = buf.length; in CharArrayReader()
104 buf = null;
115 return buf != null;
[all …]
/libcore/luni/src/main/java/java/lang/reflect/
DModifier.java262 StringBuilder buf = new StringBuilder(); in toString() local
264 buf.append("public "); in toString()
267 buf.append("protected "); in toString()
270 buf.append("private "); in toString()
273 buf.append("abstract "); in toString()
276 buf.append("static "); in toString()
279 buf.append("final "); in toString()
282 buf.append("transient "); in toString()
285 buf.append("volatile "); in toString()
288 buf.append("synchronized "); in toString()
[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/luni/src/main/java/java/util/zip/
DDeflater.java201 public int deflate(byte[] buf) { in deflate() argument
202 return deflate(buf, 0, buf.length); in deflate()
211 public synchronized int deflate(byte[] buf, int offset, int byteCount) { in deflate() argument
212 return deflateImpl(buf, offset, byteCount, flushParm); in deflate()
228 public synchronized int deflate(byte[] buf, int offset, int byteCount, int flush) { in deflate() argument
232 return deflateImpl(buf, offset, byteCount, flush); in deflate()
235 private synchronized int deflateImpl(byte[] buf, int offset, int byteCount, int flush) { in deflateImpl() argument
237 Arrays.checkOffsetAndCount(buf.length, offset, byteCount); in deflateImpl()
241 return deflateImpl(buf, offset, byteCount, streamHandle, flush); in deflateImpl()
244 … private native int deflateImpl(byte[] buf, int offset, int byteCount, long handle, int flushParm); in deflateImpl() argument
[all …]

1234567891011