Searched refs:buf (Results 76 - 100 of 282) sorted by relevance

1234567891011>>

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
H A DWrappedFloatBufferTest.java23 buf = FloatBuffer.wrap(new float[BUFFER_LENGTH]);
24 loadTestData1(buf);
25 baseBuf = buf;
31 buf = null;
82 FloatBuffer buf = FloatBuffer.wrap(array, 2, 16);
83 assertEquals(buf.position(), 2);
84 assertEquals(buf.limit(), 18);
85 assertEquals(buf.capacity(), 20);
H A DWrappedIntBufferTest.java23 buf = IntBuffer.wrap(new int[BUFFER_LENGTH]);
24 loadTestData1(buf);
25 baseBuf = buf;
31 buf = null;
82 IntBuffer buf = IntBuffer.wrap(array, 2, 16);
83 assertEquals(buf.position(), 2);
84 assertEquals(buf.limit(), 18);
85 assertEquals(buf.capacity(), 20);
H A DWrappedLongBufferTest.java23 buf = LongBuffer.wrap(new long[BUFFER_LENGTH]);
24 loadTestData1(buf);
25 baseBuf = buf;
31 buf = null;
82 LongBuffer buf = LongBuffer.wrap(array, 2, 16);
83 assertEquals(buf.position(), 2);
84 assertEquals(buf.limit(), 18);
85 assertEquals(buf.capacity(), 20);
H A DWrappedShortBufferTest.java23 buf = ShortBuffer.wrap(new short[BUFFER_LENGTH]);
24 loadTestData1(buf);
25 baseBuf = buf;
31 buf = null;
82 ShortBuffer buf = ShortBuffer.wrap(array, 2, 16);
83 assertEquals(buf.position(), 2);
84 assertEquals(buf.limit(), 18);
85 assertEquals(buf.capacity(), 20);
H A DWrappedCharBufferTest1.java25 buf = CharBuffer.wrap(new char[BUFFER_LENGTH]);
26 loadTestData1(buf);
27 baseBuf = buf;
33 buf = null;
H A DWrappedByteBufferTest.java25 buf = ByteBuffer.wrap(new byte[BUFFER_LENGTH]);
26 baseBuf = buf;
31 buf = null;
86 assertFalse(buf.isDirect());
90 assertTrue(buf.hasArray());
94 assertFalse(buf.isReadOnly());
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DStringReaderTest.java45 char[] buf = new char[10];
46 sr.read(buf, 0, 2);
63 char[] buf = new char[10];
64 sr.read(buf, 0, 2);
65 assertTrue("Failed to return to mark", new String(buf, 0, 2)
97 char[] buf = new char[testString.length()];
98 int r = sr.read(buf, 0, testString.length());
100 assertTrue("Read chars incorrectly", new String(buf, 0, r)
131 char[] buf = new char[10];
132 sr.read(buf,
[all...]
H A DFileReaderTest.java47 char[] buf = new char[100];
48 int r = br.read(buf);
51 new String(buf, 0, r));
63 char[] buf = new char[100];
64 int r = br.read(buf);
68 new String(buf, 0, r));
79 char[] buf = new char[100];
80 int r = br.read(buf);
83 new String(buf, 0, r));
H A DBufferedInputStreamTest.java141 assertNotNull(MockBufferedInputStream.buf);
142 MockBufferedInputStream.buf = null;
144 assertNotNull(MockBufferedInputStream.buf);
148 static byte[] buf; field in class:BufferedInputStreamTest.MockBufferedInputStream
152 buf = super.buf;
157 buf = super.buf;
191 BufferedInputStream buf = new BufferedInputStream(null, 5);
192 buf
[all...]
H A DFileWriterTest.java49 char[] buf = new char[100];
50 int r = br.read(buf);
53 new String(buf, 0, r));
103 char[] buf = new char[100];
104 int r = br.read(buf);
107 assertTrue("Failed to write correct chars: " + new String(buf, 0, r),
108 new String(buf, 0, r).equals("Test String"));
122 char[] buf = new char[100];
123 int r = br.read(buf);
126 new String(buf,
[all...]
H A DPipedWriterTest.java29 public char[] buf = new char[10]; field in class:PipedWriterTest.PReader
46 for (int i = 0; i < buf.length; i++) {
50 buf[i] = (char) r;
77 char[] buf = new char[10];
78 "HelloWorld".getChars(0, 10, buf, 0);
83 pw.write(buf);
87 reader.buf));
95 char[] buf = new char[10];
96 "HelloWorld".getChars(0, 10, buf, 0);
102 pw.write(buf);
[all...]
H A DSequenceInputStreamTest.java89 byte buf[] = new byte[s1.length() + s2.length()];
90 si.read(buf, 0, s1.length());
91 si.read(buf, s1.length(), s2.length());
92 assertTrue("Read incorrect bytes: " + new String(buf), new String(
93 buf, "UTF-8").equals(s1 + s2));
148 byte buf[] = new byte[s1.length() + s2.length()];
149 si.read(buf, 0, s1.length());
150 si.read(buf, s1.length(), s2.length());
151 assertTrue("Read incorrect bytes: " + new String(buf), new String(
152 buf, "UT
[all...]
/libcore/support/src/test/java/tests/support/
H A DSupport_ASimpleOutputStream.java16 public byte[] buf; field in class:Support_ASimpleOutputStream
35 buf = new byte[bufferSize];
83 buf[pos] = (byte)(oneByte & 255);
92 System.arraycopy(buf, 0, toReturn, 0, pos);
97 return new String(buf, 0, pos);
H A DSupport_ASimpleReader.java16 public char[] buf; field in class:Support_ASimpleReader
35 buf = input.toCharArray();
37 len = buf.length;
63 System.arraycopy(buf, pos, dest, offset, readable);
H A DSupport_ASimpleWriter.java16 public char[] buf; field in class:Support_ASimpleWriter
35 buf = new char[bufferSize];
59 if (offset < 0 || count < 0 || (offset + count) > buf.length) {
63 System.arraycopy(src, offset, buf, pos, count);
73 System.arraycopy(buf, 0, toReturn, 0, pos);
78 return new String(buf, 0, pos);
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DUtil.java93 ByteBuffer buf = buffers[start];
94 if (buf.capacity() < size) {
95 buf = null;
102 buf = bb;
106 if (buf == null)
118 buf.rewind();
119 buf.limit(size);
120 return buf;
123 boolean offerFirst(ByteBuffer buf) { argument
128 buffers[start] = buf;
134 offerLast(ByteBuffer buf) argument
182 releaseTemporaryDirectBuffer(ByteBuffer buf) argument
191 offerFirstTemporaryDirectBuffer(ByteBuffer buf) argument
206 offerLastTemporaryDirectBuffer(ByteBuffer buf) argument
218 free(ByteBuffer buf) argument
[all...]
H A DIOVecWrapper.java58 private final ByteBuffer[] buf; field in class:IOVecWrapper
87 this.buf = new ByteBuffer[size];
110 void setBuffer(int i, ByteBuffer buf, int pos, int rem) { argument
111 this.buf[i] = buf;
116 void setShadow(int i, ByteBuffer buf) { argument
117 shadow[i] = buf;
121 return buf[i];
137 buf[i] = null;
/libcore/ojluni/src/main/java/java/io/
H A DPushbackReader.java40 private char[] buf; field in class:PushbackReader
57 this.buf = new char[size];
72 if (buf == null)
87 if (pos < buf.length)
88 return buf[pos++];
118 int avail = buf.length - pos;
122 System.arraycopy(buf, pos, cbuf, off, avail);
156 buf[--pos] = (char) c;
180 System.arraycopy(cbuf, off, buf, pos, len);
207 return (pos < buf
[all...]
H A DPushbackInputStream.java57 protected byte[] buf; field in class:PushbackInputStream
62 * <code>buf.length</code>; when the buffer is full, <code>pos</code> is
96 this.buf = new byte[size];
136 if (pos < buf.length) {
137 return buf[pos++] & 0xff;
175 int avail = buf.length - pos;
180 System.arraycopy(buf, pos, b, off, avail);
211 buf[--pos] = (byte)b;
235 System.arraycopy(b, off, buf, pos, len);
276 int n = buf
[all...]
/libcore/ojluni/src/main/java/java/util/zip/
H A DDeflaterOutputStream.java52 protected byte[] buf; field in class:DeflaterOutputStream
90 this.buf = new byte[size];
187 byte[] buf = new byte[1];
188 buf[0] = (byte)(b & 0xff);
189 write(buf, 0, 1);
253 while ((len = def.deflate(buf, 0, buf.length)) > 0) {
254 out.write(buf, 0, len);
276 while ((len = def.deflate(buf, 0, buf
[all...]
/libcore/luni/src/test/java/libcore/java/io/
H A DOldStringReaderTest.java39 char[] buf = new char[testString.length()];
42 sr.read(buf, 0, -1);
48 sr.read(buf, -1, 1);
54 sr.read(buf, 1, testString.length());
H A DOldSequenceInputStreamTest.java117 byte[] buf = new byte[4];
118 si.read(buf, 0, 2);
119 si.read(buf, 2, 1);
121 si.read(buf, 3, 1);
122 assertEquals("Wrong stuff read!", "Hell", new String(buf));
125 si.read(buf, 3, 1);
131 buf = new byte[10];
136 si.read(buf, -1, 1);
142 si.read(buf, 0, -1);
148 si.read(buf,
[all...]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DMessageDigestSpiTest.java149 ByteBuffer buf = ByteBuffer.wrap(b, 0, b.length);
150 buf.get(b);
151 int limit = buf.limit();
152 md.engineUpdate(buf);
153 assertEquals(limit, buf.limit());
154 assertEquals(limit, buf.position());
156 buf = ByteBuffer.wrap(b, 0, b.length);
157 buf.get();
158 buf.get();
159 buf
200 engineDigest(byte[] buf, int offset, int len) argument
[all...]
/libcore/ojluni/src/main/java/java/sql/
H A DDate.java160 char buf[] = "2000-00-00".toCharArray();
161 buf[0] = Character.forDigit(year/1000,10);
162 buf[1] = Character.forDigit((year/100)%10,10);
163 buf[2] = Character.forDigit((year/10)%10,10);
164 buf[3] = Character.forDigit(year%10,10);
165 buf[5] = Character.forDigit(month/10,10);
166 buf[6] = Character.forDigit(month%10,10);
167 buf[8] = Character.forDigit(day/10,10);
168 buf[9] = Character.forDigit(day%10,10);
170 return new String(buf);
[all...]
/libcore/ojluni/src/main/java/sun/misc/
H A DCharacterEncoder.java215 byte [] buf = null;
225 buf = tmp;
230 if (buf == null) {
232 * This class doesn't have a concept of encode(buf, len, off),
236 buf = new byte[bb.remaining()];
241 bb.get(buf);
244 return buf;
255 byte [] buf = getBytes(aBuffer);
256 encode(buf, aStream);
266 byte [] buf
[all...]

Completed in 550 milliseconds

1234567891011>>