Searched refs:available (Results 1 - 25 of 92) sorted by relevance

1234

/libcore/luni/src/main/java/java/io/
H A DBufferedWriter.java195 int available = this.buf.length - pos;
196 if (count < available) {
197 available = count;
199 if (available > 0) {
200 System.arraycopy(buffer, offset, this.buf, pos, available);
201 pos += available;
206 if (count > available) {
207 offset += available;
208 available = count - available;
[all...]
H A DObjectInput.java31 * @return the number of bytes available.
35 public int available() throws IOException; method in interface:ObjectInput
49 * reached. Blocks if no input is available.
H A DFilterInputStream.java52 public int available() throws IOException { method in class:FilterInputStream
53 return in.available();
H A DLineNumberInputStream.java62 * {@code available} returns only {@code in.available() / 2} bytes as
66 public int available() throws IOException { method in class:LineNumberInputStream
67 return in.available() / 2 + (lastChar == -1 ? 0 : 1);
H A DSequenceInputStream.java82 public int available() throws IOException { method in class:SequenceInputStream
84 return in.available();
H A DInputStream.java78 * available. In particular, an implementation that always returns 0 would be correct.
83 * <p>Thirdly, the fact that a given number of bytes is "available" does not guarantee that a
96 * available.
98 * @return the estimated number of bytes available
101 public int available() throws IOException { method in class:InputStream
/libcore/support/src/test/java/tests/support/
H A DSupport_ASimpleReader.java60 int available = len - pos;
61 if (available > 0) {
62 int readable = (available < count ? available : count);
H A DSupport_ASimpleInputStream.java55 public int available() throws IOException { method in class:Support_ASimpleInputStream
/libcore/luni/src/main/java/java/util/zip/
H A DDeflaterInputStream.java39 private boolean available = true; field in class:DeflaterInputStream
121 if (!available) {
144 available = false;
148 available = false;
170 * {@link InputStream#available()}, and violates the <a
174 * @return 0 if no further bytes are available. Otherwise returns 1,
176 * available.
180 public int available() throws IOException { method in class:DeflaterInputStream
182 return available ? 1 : 0;
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/zip/
H A DDeflaterInputStreamTest.java55 * DeflaterInputStream#available()
60 assertEquals(1, dis.available());
62 assertEquals(1, dis.available());
64 assertEquals(0, dis.available());
66 assertEquals(0, dis.available());
69 dis.available();
82 assertEquals(1, dis.available());
85 dis.available();
128 assertEquals(1, dis.available());
130 assertEquals(1, dis.available());
[all...]
H A DInflaterInputStreamTest.java232 // InflaterInputStream.available() returns either 1 or 0, even though
233 // that contradicts the behavior defined in InputStream.available()
235 assertEquals(1, in.available());
237 assertEquals(1, in.available());
239 assertEquals(1, in.available());
241 assertEquals(0, in.available());
250 assertEquals(1, in.available());
252 assertEquals(0, in.available());
261 assertEquals(0, in.available());
378 // Test for skipping more bytes than available i
[all...]
/libcore/luni/src/main/java/java/util/concurrent/
H A DSemaphore.java14 * available, and then takes it. Each {@link #release} adds a permit,
17 * keeps a count of the number available and acts accordingly.
25 * private final Semaphore available = new Semaphore(MAX_AVAILABLE, true);
28 * available.acquire();
34 * available.release();
67 * the semaphore, guaranteeing that an item is available for use. When
78 * only has at most one permit available, can serve as a mutual
81 * available, or zero permits available. When used in this way, the
105 * available
[all...]
H A DDelayQueue.java66 * Condition signalled when a newer element becomes available
70 private final Condition available = lock.newCondition(); field in class:DelayQueue
114 available.signal();
170 * until an element with an expired delay is available on this queue.
182 available.await();
189 available.await();
194 available.awaitNanos(delay);
204 available.signal();
211 * until an element with an expired delay is available on this queue,
216 * an expired delay becomes available
[all...]
/libcore/luni/src/test/java/libcore/java/util/zip/
H A DDeflaterInputStreamTest.java35 assertEquals(1, in.available());
40 assertEquals(0, in.available());
46 in.available();
68 assertEquals(1, in.available());
74 assertEquals(0, in.available());
80 in.available();
/libcore/luni/src/main/java/libcore/net/url/
H A DFtpURLInputStream.java72 public int available() throws IOException { method in class:FtpURLInputStream
73 return is.available();
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DPipedInputStreamTest.java74 pis.available();
101 * java.io.PipedInputStream#available()
115 + pis.available(), pis.available() == 1000);
125 assertEquals("Incorrect available count", 1024, pin.available());
155 assertEquals("Non-conected pipe returned non-zero available bytes", 0,
156 pis.available());
166 .available());
184 .available());
[all...]
H A DBufferedOutputStreamTest.java135 assertEquals("Bytes written, not buffered", 0, bais.available());
138 assertEquals("Bytes not written after flush", 500, bais.available());
142 bais.available() >= 1000);
653 assertEquals("Byte written, not buffered", 0, bais.available());
656 assertEquals("Byte not written after flush", 1, bais.available());
690 assertEquals("Bytes written, not buffered", 10, byteArrayis.available());
694 .available());
701 assertEquals("Bytes written, not buffered", 20, byteArrayis.available());
705 .available());
715 assertEquals("Bytes written, not buffered", 30, byteArrayis.available());
[all...]
H A DByteArrayInputStreamTest.java38 bis.available() == fileString.length());
49 .available());
74 * ByteArrayInputStream#available()
77 assertTrue("Returned incorrect number of available bytes", is
78 .available() == fileString.length());
H A DFilterOutputStreamTest.java83 bis.available() == fileString.length());
100 bis.available() == fileString.length());
116 assertEquals("Byte not written after flush", 1, bis.available());
H A DStringBufferInputStreamTest.java36 * java.io.StringBufferInputStream#available()
39 // Test for method int java.io.StringBufferInputStream.available()
40 assertEquals("Returned incorrect number of available bytes", 11, sbis
41 .available());
H A DBufferedInputStreamTest.java124 // still be available.
162 * java.io.BufferedInputStream#available()
165 assertTrue("Returned incorrect number of available bytes", is
166 .available() == INPUT.length());
168 // Test that a closed stream throws an IOE for available()
172 int available = bis.available();
174 assertTrue(available != 0);
177 bis.available();
411 if (toRead > available()) {
[all...]
/libcore/luni/src/main/java/javax/crypto/
H A DCipherInputStream.java83 * cipher. Returns {@code true} if output from the cipher is available to
158 int available = outputLength - outputIndex;
159 if (available < len) {
160 len = available;
175 public int available() throws IOException { method in class:CipherInputStream
/libcore/luni/src/test/java/libcore/java/io/
H A DOldBufferedOutputStreamTest.java93 0, bais.available());
97 500, bais.available());
101 bais.available() >= 1000);
161 0, bais.available());
165 1, bais.available());
H A DFilterInputStreamNullSourceTest.java56 assertEquals(0, in.available());
113 in.available();
129 in.available();
H A DOldSequenceInputStreamTest.java32 assertEquals("Returned incorrect number of bytes!", s1.length(), si.available());
35 si.available() == s1.length());
38 si.available();

Completed in 313 milliseconds

1234