Searched refs:buf (Results 51 - 75 of 314) sorted by relevance

1234567891011>>

/libcore/luni/src/test/java/libcore/java/io/
H A DOldStringBufferInputStreamTest.java29 byte[] buf = new byte[10];
31 sbis.read(buf, 0, -1);
37 sbis.read(buf, -1, 1);
43 sbis.read(buf, 10, 1);
H A DOldReaderTest.java36 CharBuffer buf = CharBuffer.allocate(4);
37 assertEquals("Wrong return value!", 4, simple.read(buf));
38 buf.rewind();
39 assertEquals("Wrong stuff read!", "Bla ", String.valueOf(buf));
40 simple.read(buf);
41 buf.rewind();
42 assertEquals("Wrong stuff read!", "bla,", String.valueOf(buf));
45 simple.read(buf);
54 char[] buf = new char[4];
55 assertEquals("Wrong return value!", 4, simple.read(buf));
116 read(char[] buf, int offset, int count) argument
[all...]
H A DOldPushbackInputStreamTest.java126 byte[] buf = ("01234567890123456789").getBytes();
129 tobj.read(buf, 6, 5);
130 assertEquals("Wrong value read!", "BEGIN", new String(buf, 6, 5));
131 assertEquals("Too much read!", "012345BEGIN123456789", new String(buf));
134 tobj.read(buf, 6, 5);
143 byte[] buf = new byte[10];
147 tobj.read(buf, -1, 1);
153 tobj.read(buf, 0, -1);
159 tobj.read(buf, 10, 1);
168 byte[] buf
[all...]
/libcore/ojluni/src/test/java/time/test/java/time/format/
H A DTestPadPrinterDecorator.java78 getFormatter().formatTo(EMPTY_DTA, buf);
79 assertEquals(buf.toString(), "--Z");
84 getFormatter().formatTo(LocalDate.of(2008, 12, 3), buf);
85 assertEquals(buf.toString(), "--Z");
89 buf.append("EXISTING");
91 getFormatter().formatTo(EMPTY_DTA, buf);
92 assertEquals(buf.toString(), "EXISTING--Z");
98 getFormatter().formatTo(EMPTY_DTA, buf);
99 assertEquals(buf.toString(), "Z");
104 getFormatter().formatTo(EMPTY_DTA, buf);
[all...]
/libcore/luni/src/main/native/
H A DJniException.cpp23 char buf[BUFSIZ]; local
24 jniThrowException(env, exceptionClassName, jniStrError(error, buf, sizeof(buf)));
/libcore/ojluni/src/main/java/java/io/
H A DCharArrayWriter.java47 protected char buf[]; field in class:CharArrayWriter
72 buf = new char[initialSize];
81 if (newcount > buf.length) {
82 buf = Arrays.copyOf(buf, Math.max(buf.length << 1, newcount));
84 buf[count] = (char)c;
104 if (newcount > buf.length) {
105 buf = Arrays.copyOf(buf, Mat
[all...]
H A DByteArrayInputStream.java48 * by the creator of the stream. Elements <code>buf[0]</code>
49 * through <code>buf[count-1]</code> are the
51 * stream; element <code>buf[pos]</code> is
54 protected byte buf[]; field in class:ByteArrayInputStream
61 * will be <code>buf[pos]</code>.
84 * and not larger than the length of <code>buf</code>.
86 * the last byte within <code>buf</code> that
93 * so that it uses <code>buf</code> as its
99 * <code>buf</code>.
101 * @param buf th
103 ByteArrayInputStream(byte buf[]) argument
123 ByteArrayInputStream(byte buf[], int offset, int length) argument
[all...]
H A DStringWriter.java43 private StringBuffer buf; field in class:StringWriter
50 buf = new StringBuffer();
51 lock = buf;
69 buf = new StringBuffer(initialSize);
70 lock = buf;
77 buf.append((char) c);
94 buf.append(cbuf, off, len);
101 buf.append(str);
112 buf.append(str.substring(off, off + len));
210 return buf
[all...]
H A DCharArrayReader.java37 protected char buf[]; field in class:CharArrayReader
53 * @param buf Input buffer (not copied)
55 public CharArrayReader(char buf[]) { argument
56 this.buf = buf;
58 this.count = buf.length;
67 * <tt>buf.length-offset</tt>, whichever is smaller.
71 * <tt>buf.length</tt>, or if <tt>length</tt> is negative, or if
74 * @param buf Input buffer (not copied)
78 public CharArrayReader(char buf[], in argument
[all...]
H A DByteArrayOutputStream.java50 protected byte buf[]; field in class:ByteArrayOutputStream
77 buf = new byte[size];
92 if (minCapacity - buf.length > 0)
112 int oldCapacity = buf.length;
118 buf = Arrays.copyOf(buf, newCapacity);
136 buf[count] = (byte) b;
154 System.arraycopy(b, off, buf, count, len);
161 * stream's write method using <code>out.write(buf, 0, count)</code>.
167 out.write(buf,
[all...]
/libcore/ojluni/src/main/java/java/util/zip/
H A DCheckedInputStream.java70 * @param buf the buffer into which the data is read
75 * @exception NullPointerException If <code>buf</code> is <code>null</code>.
78 * <code>buf.length - off</code>
81 public int read(byte[] buf, int off, int len) throws IOException { argument
82 len = in.read(buf, off, len);
84 cksum.update(buf, off, len);
96 byte[] buf = new byte[512];
100 len = read(buf, 0, len < buf.length ? (int)len : buf
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
H A DWrappedCharBufferTest2.java28 buf = CharBuffer.wrap(TEST_STRING);
29 baseBuf = buf;
35 buf = null;
74 buf.array();
83 buf.put(array, 0, array.length);
89 buf.put((char[]) null, 0, 1);
95 buf.put(new char[buf.capacity() + 1], 0, buf.capacity() + 1);
101 buf
[all...]
H A DDirectCharBufferTest.java28 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*2).asCharBuffer();
29 super.loadTestData1(buf);
30 baseBuf = buf;
34 buf = null;
39 assertFalse(buf.hasArray());
44 buf.array();
52 buf.arrayOffset();
73 assertTrue(buf.isDirect());
77 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
H A DDirectDoubleBufferTest.java27 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*8).asDoubleBuffer();
28 loadTestData1(buf);
29 baseBuf = buf;
33 buf = null;
38 assertFalse(buf.hasArray());
43 buf.array();
51 buf.arrayOffset();
72 assertTrue(buf.isDirect());
76 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
H A DDirectFloatBufferTest.java27 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*4).asFloatBuffer();
28 loadTestData1(buf);
29 baseBuf = buf;
33 buf = null;
38 assertFalse(buf.hasArray());
43 buf.array();
51 buf.arrayOffset();
73 assertTrue(buf.isDirect());
77 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
H A DDirectIntBufferTest.java27 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*4).asIntBuffer();
28 loadTestData1(buf);
29 baseBuf = buf;
33 buf = null;
38 assertFalse(buf.hasArray());
43 buf.array();
51 buf.arrayOffset();
73 assertTrue(buf.isDirect());
77 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
H A DDirectLongBufferTest.java27 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*8).asLongBuffer();
28 loadTestData1(buf);
29 baseBuf = buf;
33 buf = null;
38 assertFalse(buf.hasArray());
43 buf.array();
51 buf.arrayOffset();
73 assertTrue(buf.isDirect());
77 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
H A DDirectShortBufferTest.java27 buf = ByteBuffer.allocateDirect(BUFFER_LENGTH*2).asShortBuffer();
28 loadTestData1(buf);
29 baseBuf = buf;
33 buf = null;
38 assertFalse(buf.hasArray());
43 buf.array();
51 buf.arrayOffset();
73 assertTrue(buf.isDirect());
77 assertEquals(ByteOrder.BIG_ENDIAN, buf.order());
/libcore/ojluni/src/main/native/
H A DAdler32.c44 Bytef buf[1]; local
46 buf[0] = (Bytef)b;
47 return adler32(adler, buf, 1);
54 Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); local
55 if (buf) {
56 adler = adler32(adler, buf + off, len);
57 (*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0);
66 Bytef *buf = (Bytef *)jlong_to_ptr(address); local
67 if (buf) {
68 adler = adler32(adler, buf
[all...]
H A Djava_util_zip_CRC32.c42 Bytef buf[1]; local
44 buf[0] = (Bytef)b;
45 return crc32(crc, buf, 1);
52 Bytef *buf = (*env)->GetPrimitiveArrayCritical(env, b, 0); local
53 if (buf) {
54 crc = crc32(crc, buf + off, len);
55 (*env)->ReleasePrimitiveArrayCritical(env, b, buf, 0);
61 ZIP_CRC32(jint crc, const jbyte *buf, jint len) argument
63 return crc32(crc, (Bytef*)buf, len);
70 Bytef *buf local
[all...]
/libcore/ojluni/src/main/java/sun/security/util/
H A DDerInputBuffer.java47 DerInputBuffer(byte[] buf) { super(buf); } argument
49 DerInputBuffer(byte[] buf, int offset, int len) { argument
50 super(buf, offset, len);
70 System.arraycopy(buf, pos, retval, 0, len);
81 System.arraycopy(buf, startPos, result, 0, size);
90 return buf[pos];
112 if (this.buf[this.pos + i] != other.buf[other.pos + i]) {
131 retval += buf[
[all...]
/libcore/support/src/test/java/tests/support/
H A DSupport_ASimpleInputStream.java16 public byte[] buf; field in class:Support_ASimpleInputStream
35 buf = input.getBytes();
37 len = buf.length;
43 buf = new byte[len];
44 System.arraycopy(input, 0, buf, 0, len);
68 int res = buf[pos];
/libcore/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/
H A DChunk.java56 public Chunk(int type, ByteBuffer buf) { argument
59 this.data = buf.array();
60 this.offset = buf.arrayOffset();
61 this.length = buf.position();
/libcore/luni/src/test/java/libcore/java/nio/
H A DNoArrayTest.java31 private void assertNoArray(ByteBuffer buf) { argument
32 assertFalse(buf.hasArray());
34 buf.array();
40 buf.arrayOffset();
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DPushbackInputStreamTest.java147 byte[] buf = new byte[100];
148 pis.read(buf, 0, buf.length);
149 assertTrue("Incorrect bytes read", new String(buf, "UTF-8")
161 byte[] buf = new byte[50];
163 pis.read(buf, 0, buf.length);
164 assertTrue("a) Incorrect bytes read", new String(buf, "UTF-8")
166 pis.unread(buf);
180 byte[] buf
[all...]

Completed in 818 milliseconds

1234567891011>>