Home
last modified time | relevance | path

Searched refs:available (Results 1 – 25 of 97) sorted by relevance

1234

/libcore/luni/src/main/java/java/io/
DBufferedWriter.java195 int available = this.buf.length - pos; in write() local
196 if (count < available) { in write()
197 available = count; in write()
199 if (available > 0) { in write()
200 System.arraycopy(buffer, offset, this.buf, pos, available); in write()
201 pos += available; in write()
206 if (count > available) { in write()
207 offset += available; in write()
208 available = count - available; in write()
209 if (available >= this.buf.length) { in write()
[all …]
DFilterInputStream.java52 public int available() throws IOException { in available() method in FilterInputStream
53 return in.available(); in available()
DLineNumberInputStream.java66 public int available() throws IOException { in available() method in LineNumberInputStream
67 return in.available() / 2 + (lastChar == -1 ? 0 : 1); in available()
DBufferedInputStream.java116 public synchronized int available() throws IOException { in available() method in BufferedInputStream
121 return count - pos + localIn.available(); in available()
274 if (copylength == byteCount || localIn.available() == 0) { in read()
314 if (localIn.available() == 0) { in read()
DSequenceInputStream.java82 public int available() throws IOException { in available() method in SequenceInputStream
84 return in.available(); in available()
DBufferedReader.java297 int available = end - pos; in read() local
298 if (available > 0) { in read()
299 int count = available >= outstanding ? outstanding : available; in read()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/zip/
DDeflaterInputStreamTest.java60 assertEquals(1, dis.available()); in testAvailable()
62 assertEquals(1, dis.available()); in testAvailable()
64 assertEquals(0, dis.available()); in testAvailable()
66 assertEquals(0, dis.available()); in testAvailable()
69 dis.available(); in testAvailable()
82 assertEquals(1, dis.available()); in testClose()
85 dis.available(); in testClose()
128 assertEquals(1, dis.available()); in testRead()
130 assertEquals(1, dis.available()); in testRead()
132 assertEquals(1, dis.available()); in testRead()
[all …]
DInflaterInputStreamTest.java235 assertEquals(1, in.available()); in testAvailableNonEmptySource()
237 assertEquals(1, in.available()); in testAvailableNonEmptySource()
239 assertEquals(1, in.available()); in testAvailableNonEmptySource()
241 assertEquals(0, in.available()); in testAvailableNonEmptySource()
250 assertEquals(1, in.available()); in testAvailableSkip()
252 assertEquals(0, in.available()); in testAvailableSkip()
261 assertEquals(0, in.available()); in testAvailableEmptySource()
449 int available; in test_available() local
452 available = iis.available(); in test_available()
453 if (available == 0) { in test_available()
[all …]
/libcore/luni/src/main/java/java/util/zip/
DDeflaterInputStream.java39 private boolean available = true; field in DeflaterInputStream
121 if (!available) { in read()
144 available = false; in read()
148 available = false; in read()
180 public int available() throws IOException { in available() method in DeflaterInputStream
182 return available ? 1 : 0; in available()
/libcore/support/src/test/java/tests/support/
DSupport_ASimpleReader.java60 int available = len - pos; in read() local
61 if (available > 0) { in read()
62 int readable = (available < count ? available : count); in read()
/libcore/luni/src/test/java/libcore/java/util/zip/
DDeflaterInputStreamTest.java35 assertEquals(1, in.available()); in testReadByteByByte()
40 assertEquals(0, in.available()); in testReadByteByByte()
46 in.available(); in testReadByteByByte()
68 assertEquals(1, in.available()); in testReadWithBuffer()
74 assertEquals(0, in.available()); in testReadWithBuffer()
80 in.available(); in testReadWithBuffer()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DBufferedOutputStreamTest.java135 assertEquals("Bytes written, not buffered", 0, bais.available()); in test_write$BII()
138 assertEquals("Bytes not written after flush", 500, bais.available()); in test_write$BII()
142 bais.available() >= 1000); in test_write$BII()
653 assertEquals("Byte written, not buffered", 0, bais.available()); in test_writeI()
656 assertEquals("Byte not written after flush", 1, bais.available()); in test_writeI()
690 assertEquals("Bytes written, not buffered", 10, byteArrayis.available()); in test_write_Scenario1()
694 .available()); in test_write_Scenario1()
701 assertEquals("Bytes written, not buffered", 20, byteArrayis.available()); in test_write_Scenario1()
705 .available()); in test_write_Scenario1()
715 assertEquals("Bytes written, not buffered", 30, byteArrayis.available()); in test_write_Scenario1()
[all …]
DPipedInputStreamTest.java74 pis.available(); in test_ConstructorLjava_io_PipedOutputStream()
115 + pis.available(), pis.available() == 1000); in test_available()
125 assertEquals("Incorrect available count", 1024, pin.available()); in test_available()
156 pis.available()); in test_connectLjava_io_PipedOutputStream()
166 .available()); in test_connectLjava_io_PipedOutputStream()
184 .available()); in test_read()
205 + pis.available(), pis.available() == 1000); in test_read$BII()
DBufferedInputStreamTest.java166 .available() == INPUT.length()); in test_available()
172 int available = bis.available(); in test_available() local
174 assertTrue(available != 0); in test_available()
177 bis.available(); in test_available()
411 if (toRead > available()) { in test_read$BII()
412 toRead = available(); in test_read$BII()
420 public int available() { in test_read$BII()
DFilterOutputStreamTest.java83 bis.available() == fileString.length()); in test_write$B()
100 bis.available() == fileString.length()); in test_write$BII()
116 assertEquals("Byte not written after flush", 1, bis.available()); in test_writeI()
DByteArrayInputStreamTest.java38 bis.available() == fileString.length()); in test_Constructor$B()
49 .available()); in test_Constructor$BII()
78 .available() == fileString.length()); in test_available()
/libcore/luni/src/main/java/java/util/concurrent/
DSemaphore.java150 int available = getState(); in nonfairTryAcquireShared() local
151 int remaining = available - acquires; in nonfairTryAcquireShared()
153 compareAndSetState(available, remaining)) in nonfairTryAcquireShared()
218 int available = getState(); in tryAcquireShared() local
219 int remaining = available - acquires; in tryAcquireShared()
221 compareAndSetState(available, remaining)) in tryAcquireShared()
DDelayQueue.java70 private final Condition available = lock.newCondition(); field in DelayQueue
114 available.signal(); in offer()
182 available.await(); in take()
189 available.await(); in take()
194 available.awaitNanos(delay); in take()
204 available.signal(); in take()
230 nanos = available.awaitNanos(nanos); in poll()
239 nanos = available.awaitNanos(nanos); in poll()
244 long timeLeft = available.awaitNanos(delay); in poll()
255 available.signal(); in poll()
/libcore/luni/src/main/java/javax/crypto/
DCipherInputStream.java158 int available = outputLength - outputIndex; in read() local
159 if (available < len) { in read()
160 len = available; in read()
175 public int available() throws IOException { in available() method in CipherInputStream
/libcore/luni/src/test/java/libcore/java/io/
DOldBufferedOutputStreamTest.java93 0, bais.available()); in test_write$BII()
97 500, bais.available()); in test_write$BII()
101 bais.available() >= 1000); in test_write$BII()
161 0, bais.available()); in test_writeI()
165 1, bais.available()); in test_writeI()
DFilterInputStreamNullSourceTest.java56 assertEquals(0, in.available()); in testCipherInputStream()
113 in.available(); in assertReadsFailWithIoException()
129 in.available(); in assertReadsFailWithNullPointerException()
DOldPushbackInputStreamTest.java92 assertEquals("Wrong number!", 30, tobj.available()); in test_available()
95 tobj.available(); in test_available()
172 assertEquals("Wrong number!", 30 - 6, tobj.available()); in test_skipJ()
209 assertEquals("Wrong number!", 30 + 10, tobj.available()); in test_unread$B()
249 assertEquals("Wrong number!", 30 + 10, tobj.available()); in test_unread$BII()
313 assertEquals("Wrong number!", 30, tobj.available()); in test_unreadI()
DOldSequenceInputStreamTest.java32 assertEquals("Returned incorrect number of bytes!", s1.length(), si.available()); in test_available()
35 si.available() == s1.length()); in test_available()
38 si.available(); in test_available()
/libcore/luni/src/main/java/libcore/net/url/
DFtpURLInputStream.java72 public int available() throws IOException { in available() method in FtpURLInputStream
73 return is.available(); in available()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
DChannelsTest.java106 assertEquals(file.available(), compareNumber); in assertFileSizeSame()
160 assertFalse(0 == this.fins.available()); in testNewChannelInputStream()
164 assertFalse(0 == this.fins.available()); in testNewChannelInputStream()
175 assertEquals(0, ins.available()); in testNewChannelInputStream()
239 assertEquals(this.fins.available(), 1); in testNewChannelOutputStream()
271 assertEquals(this.fileSize, this.fins.available()); in testNewInputStreamReadableByteChannel_InputNull()
288 assertEquals(this.fileSize, this.fins.available()); in testNewInputStreamReadableByteChannel()
293 assertEquals(this.fins.available(), this.fileSize - this.testNum); in testNewInputStreamReadableByteChannel()
296 assertEquals(this.fins.available(), this.fileSize - this.testNum * 2); in testNewInputStreamReadableByteChannel()
298 assertEquals(this.fins.available(), this.fileSize - this.testNum * 3); in testNewInputStreamReadableByteChannel()
[all …]

1234