Home
last modified time | relevance | path

Searched refs:in (Results 1 – 25 of 514) sorted by relevance

12345678910>>...21

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DASCIICharsetEncoderTest.java139 CharBuffer in = CharBuffer.wrap("A"); in testInternalState() local
144 encoder.encode(in, out, false); in testInternalState()
145 in = CharBuffer.wrap("B"); in testInternalState()
146 encoder.encode(in, out, true); in testInternalState()
161 CharBuffer in = CharBuffer.wrap("A"); in testInternalState_Reset() local
163 newEncoder.encode(in, out, false); in testInternalState_Reset()
169 CharBuffer in = CharBuffer.wrap("A"); in testInternalState_Reset() local
171 newEncoder.encode(in, out, true); in testInternalState_Reset()
176 CharBuffer in = CharBuffer.wrap("A"); in testInternalState_Reset() local
178 newEncoder.encode(in, out, true); in testInternalState_Reset()
[all …]
DCharsetDecoderTest.java221 ByteBuffer in = getByteBuffer(); in implTestDecodeByteBuffer() local
222 out = decoder.decode(in); in implTestDecodeByteBuffer()
229 in = getByteBuffer().asReadOnlyBuffer(); in implTestDecodeByteBuffer()
230 out = decoder.decode(in); in implTestDecodeByteBuffer()
240 ByteBuffer in; in testDecodeByteBufferException() local
246 in = getMalformedByteBuffer(); in testDecodeByteBufferException()
247 if (in != null) { in testDecodeByteBufferException()
249 CharBuffer buffer = decoder.decode(in); in testDecodeByteBufferException()
256 in.rewind(); in testDecodeByteBufferException()
258 out = decoder.decode(in); in testDecodeByteBufferException()
[all …]
DCharsetEncoderTest.java285 CharBuffer in = CharBuffer.wrap("aaa"); in testFlushIllegalState() local
298 encoder.encode(in, out, true); in testFlushIllegalState()
307 encoder.encode(in, out, false); in testFlushIllegalState()
331 CharBuffer in = CharBuffer.wrap("aaa"); in testEncodeFacadeIllegalState() local
333 encoder.encode(in); in testEncodeFacadeIllegalState()
334 in.rewind(); in testEncodeFacadeIllegalState()
337 encoder.encode(in); in testEncodeFacadeIllegalState()
338 in.rewind(); in testEncodeFacadeIllegalState()
343 encoder.encode(in); in testEncodeFacadeIllegalState()
344 in.rewind(); in testEncodeFacadeIllegalState()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DGZIPInputStream.java84 public GZIPInputStream(InputStream in, int size) throws IOException { in GZIPInputStream() argument
85 super(in, in != null ? new Inflater(true) : null, size); in GZIPInputStream()
91 readHeader(in); in GZIPInputStream()
107 public GZIPInputStream(InputStream in) throws IOException { in GZIPInputStream() argument
108 this(in, 512); in GZIPInputStream()
178 CheckedInputStream in = new CheckedInputStream(this_in, crc); in readHeader() local
181 if (readUShort(in) != GZIP_MAGIC) { in readHeader()
185 if (readUByte(in) != 8) { in readHeader()
189 int flg = readUByte(in); in readHeader()
191 skipBytes(in, 6); in readHeader()
[all …]
DDeflaterInputStream.java65 if (in == null) { in ensureOpen()
77 public DeflaterInputStream(InputStream in) { in DeflaterInputStream() argument
78 this(in, in != null ? new Deflater() : null); in DeflaterInputStream()
90 public DeflaterInputStream(InputStream in, Deflater defl) { in DeflaterInputStream() argument
91 this(in, defl, 512); in DeflaterInputStream()
104 public DeflaterInputStream(InputStream in, Deflater defl, int bufLen) { in DeflaterInputStream() argument
105 super(in); in DeflaterInputStream()
108 if (in == null) in DeflaterInputStream()
127 if (in != null) { in close()
134 in.close(); in close()
[all …]
/libcore/ojluni/src/test/java/io/InputStream/
DSkip.java40 private static void dotest(InputStream in, int curpos, long total, in dotest() argument
49 long skipped = in.skip(toskip); in dotest()
63 private static void dotestExact(MyInputStream in, long curpos, long total, in dotestExact() argument
71 long pos = in.position(); in dotestExact()
73 in.skipNBytes(toskip); in dotestExact()
74 if (in.position() != pos + (toskip < 0 ? 0 : toskip)) { in dotestExact()
75 throw new RuntimeException((in.position() - pos) + in dotestExact()
93 MyInputStream in = new MyInputStream(11); in testSkip() local
96 dotest(in, 0, 11, -23, 0); in testSkip()
99 dotest(in, 0, 11, 20, 11); in testSkip()
[all …]
DTransferTo.java48 try (InputStream in = input()) { in ifOutIsNullThenNpeIsThrown() argument
49 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
52 try (InputStream in = input((byte) 1)) { in ifOutIsNullThenNpeIsThrown() argument
53 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
56 try (InputStream in = input((byte) 1, (byte) 2)) { in ifOutIsNullThenNpeIsThrown() argument
57 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
60 InputStream in = null; in ifOutIsNullThenNpeIsThrown() local
62 InputStream fin = in = new ThrowingInputStream(); in ifOutIsNullThenNpeIsThrown()
67 if (in != null) in ifOutIsNullThenNpeIsThrown()
69 in.close(); in ifOutIsNullThenNpeIsThrown()
[all …]
DReadNBytes.java68 WrapperInputStream in = new WrapperInputStream(new ByteArrayInputStream(inputBytes)); in test() local
70 int nread = in.readNBytes(readBytes, 0, readBytes.length); in test()
78 check(!in.isClosed(), "Stream unexpectedly closed"); in test()
81 nread = in.readNBytes(readBytes, 0, readBytes.length); in test()
89 check((x = in.read()) == -1, in test()
91 check((x = in.read(tmp)) == -1, in test()
93 check((x = in.read(tmp, 0, tmp.length)) == -1, in test()
95 check((x = in.readNBytes(tmp, 0, tmp.length)) == 0, in test()
97 check(!in.isClosed(), "Stream unexpectedly closed"); in test()
102 WrapperInputStream in = in test() local
[all …]
/libcore/ojluni/src/main/java/java/io/
DPipedInputStream.java89 protected int in = -1; field in PipedInputStream
206 if (in == out) in receive()
208 if (in < 0) { in receive()
209 in = 0; in receive()
212 buffer[in++] = (byte)(b & 0xFF); in receive()
213 if (in >= buffer.length) { in receive()
214 in = 0; in receive()
233 if (in == out) in receive()
236 if (out < in) { in receive()
237 nextTransferAmount = buffer.length - in; in receive()
[all …]
DFilterReader.java46 protected Reader in; field in FilterReader
54 protected FilterReader(Reader in) { in FilterReader() argument
55 super(in); in FilterReader()
56 this.in = in; in FilterReader()
65 return in.read(); in read()
75 return in.read(cbuf, off, len); in read()
84 return in.skip(n); in skip()
93 return in.ready(); in ready()
100 return in.markSupported(); in markSupported()
109 in.mark(readAheadLimit); in mark()
[all …]
DFilterInputStream.java50 protected volatile InputStream in; field in FilterInputStream
61 protected FilterInputStream(InputStream in) { in FilterInputStream() argument
62 this.in = in; in FilterInputStream()
83 return in.read(); in read()
133 return in.read(b, off, len); in read()
150 return in.skip(n); in skip()
167 return in.available(); in available()
180 in.close(); in close()
200 in.mark(readlimit); in mark()
225 in.reset(); in reset()
[all …]
DSequenceInputStream.java48 InputStream in; field in SequenceInputStream
94 if (in != null) { in nextStream()
95 in.close(); in nextStream()
102 in = (InputStream) e.nextElement(); in peekNextStream()
103 if (in == null) in peekNextStream()
106 in = null; in peekNextStream()
130 if (in == null) { in available()
133 return in.available(); in available()
155 while (in != null) { in read()
156 int c = in.read(); in read()
[all …]
DPipedReader.java66 int in = -1; field in PipedReader
180 while (in == out) { in receive()
194 if (in < 0) { in receive()
195 in = 0; in receive()
198 buffer[in++] = (char) c; in receive()
199 if (in >= buffer.length) { in receive()
200 in = 0; in receive()
243 && !closedByWriter && (in < 0)) { in read()
249 while (in < 0) { in read()
271 if (in == out) { in read()
[all …]
DInputStreamReader.java75 public InputStreamReader(InputStream in) { in InputStreamReader() argument
76 super(in); in InputStreamReader()
77 sd = StreamDecoder.forInputStreamReader(in, this, in InputStreamReader()
94 public InputStreamReader(InputStream in, String charsetName) in InputStreamReader() argument
97 super(in); in InputStreamReader()
100 sd = StreamDecoder.forInputStreamReader(in, this, charsetName); in InputStreamReader()
111 public InputStreamReader(InputStream in, Charset cs) { in InputStreamReader() argument
112 super(in); in InputStreamReader()
115 sd = StreamDecoder.forInputStreamReader(in, this, cs); in InputStreamReader()
126 public InputStreamReader(InputStream in, CharsetDecoder dec) { in InputStreamReader() argument
[all …]
DDataInputStream.java54 public DataInputStream(InputStream in) { in DataInputStream() argument
55 super(in); in DataInputStream()
103 return in.read(b, 0, b.length); in read()
152 return in.read(b, off, len); in read()
203 int count = in.read(b, off + n, len - n); in readFully()
228 while ((total<n) && ((cur = (int) in.skip(n-total)) > 0)) { in skipBytes()
250 int ch = in.read(); in readBoolean()
273 int ch = in.read(); in readByte()
296 int ch = in.read(); in readUnsignedByte()
515 switch (c = in.read()) { in readLine()
[all …]
/libcore/json/src/main/java/org/json/
DJSONTokener.java68 private final String in; field in JSONTokener
82 public JSONTokener(String in) { in JSONTokener() argument
84 if (in != null && in.startsWith("\ufeff")) { in JSONTokener()
85 in = in.substring(1); in JSONTokener()
87 this.in = in; in JSONTokener()
121 final int inLength = in.length(); in nextCleanInternal()
124 int c = in.charAt(pos++); in nextCleanInternal()
137 char peek = in.charAt(pos); in nextCleanInternal()
142 int commentEnd = in.indexOf("*/", pos); in nextCleanInternal()
183 final int inLength = in.length(); in skipToEndOfLine()
[all …]
/libcore/luni/src/test/java/libcore/java/util/zip/
DDeflaterInputStreamTest.java37 InputStream in = new DeflaterInputStream(new ByteArrayInputStream(data)); in testReadByteByByte() local
40 assertEquals(1, in.available()); in testReadByteByByte()
42 while ((b = in.read()) != -1) { in testReadByteByByte()
45 assertEquals(0, in.available()); in testReadByteByByte()
49 in.close(); in testReadByteByByte()
51 in.available(); in testReadByteByByte()
58 try (InputStream in = new InflaterInputStream(new ByteArrayInputStream(bytes))) { in inflate() argument
62 while ((count = in.read(buffer)) != -1) { in inflate()
72 InputStream in = new DeflaterInputStream(new ByteArrayInputStream(data)); in testReadWithBuffer() local
74 assertEquals(1, in.available()); in testReadWithBuffer()
[all …]
/libcore/ojluni/src/main/java/java/time/
DSer.java261 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { in readExternal() argument
262 type = in.readByte(); in readExternal()
263 object = readInternal(type, in); in readExternal()
266 static Serializable read(ObjectInput in) throws IOException, ClassNotFoundException { in read() argument
267 byte type = in.readByte(); in read()
268 return readInternal(type, in); in read()
271 private static Serializable readInternal(byte type, ObjectInput in) in readInternal() argument
274 case DURATION_TYPE: return Duration.readExternal(in); in readInternal()
275 case INSTANT_TYPE: return Instant.readExternal(in); in readInternal()
276 case LOCAL_DATE_TYPE: return LocalDate.readExternal(in); in readInternal()
[all …]
/libcore/ojluni/src/main/java/java/time/zone/
DSer.java182 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { in readExternal() argument
183 type = in.readByte(); in readExternal()
184 object = readInternal(type, in); in readExternal()
187 static Serializable read(DataInput in) throws IOException, ClassNotFoundException { in read() argument
188 byte type = in.readByte(); in read()
189 return readInternal(type, in); in read()
192 private static Serializable readInternal(byte type, DataInput in) in readInternal() argument
196 return ZoneRules.readExternal(in); in readInternal()
198 return ZoneOffsetTransition.readExternal(in); in readInternal()
200 return ZoneOffsetTransitionRule.readExternal(in); in readInternal()
[all …]
/libcore/luni/src/main/java/libcore/io/
DStreams.java60 public static int readSingleByte(@NonNull InputStream in) throws IOException { in readSingleByte() argument
62 int result = in.read(buffer, 0, 1); in readSingleByte()
97 public static void readFully(@NonNull InputStream in, @NonNull byte[] dst) throws IOException { in readFully() argument
98 readFully(in, dst, 0, dst.length); in readFully()
109 …public static void readFully(InputStream in, byte[] dst, int offset, int byteCount) throws IOExcep… in readFully() argument
113 if (in == null) { in readFully()
121 int bytesRead = in.read(dst, offset, byteCount); in readFully()
142 public static @NonNull byte[] readFully(@NonNull InputStream in) throws IOException { in readFully() argument
144 return readFullyNoClose(in); in readFully()
146 in.close(); in readFully()
[all …]
/libcore/ojluni/src/main/java/java/time/chrono/
DSer.java236 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { in readExternal() argument
237 type = in.readByte(); in readExternal()
238 object = readInternal(type, in); in readExternal()
241 static Serializable read(ObjectInput in) throws IOException, ClassNotFoundException { in read() argument
242 byte type = in.readByte(); in read()
243 return readInternal(type, in); in read()
246 private static Serializable readInternal(byte type, ObjectInput in) in readInternal() argument
249 case CHRONO_TYPE: return (Serializable)AbstractChronology.readExternal(in); in readInternal()
250 … case CHRONO_LOCAL_DATE_TIME_TYPE: return (Serializable)ChronoLocalDateTimeImpl.readExternal(in); in readInternal()
251 … case CHRONO_ZONE_DATE_TIME_TYPE: return (Serializable)ChronoZonedDateTimeImpl.readExternal(in); in readInternal()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DHostnameVerifierTest.java47 InputStream in; in testVerify() local
50 in = new ByteArrayInputStream(X509_FOO); in testVerify()
51 x509 = (X509Certificate) cf.generateCertificate(in); in testVerify()
58 in = new ByteArrayInputStream(X509_HANAKO); in testVerify()
59 x509 = (X509Certificate) cf.generateCertificate(in); in testVerify()
65 in = new ByteArrayInputStream(X509_FOO_BAR); in testVerify()
66 x509 = (X509Certificate) cf.generateCertificate(in); in testVerify()
74 in = new ByteArrayInputStream(X509_FOO_BAR_HANAKO); in testVerify()
75 x509 = (X509Certificate) cf.generateCertificate(in); in testVerify()
88 in = new ByteArrayInputStream(X509_NO_CNS_FOO); in testVerify()
[all …]
/libcore/ojluni/src/test/java/net/Socks/
DSocksServer.java67 private InputStream in; field in SocksServer.ClientHandler
78 Tunnel(InputStream in, OutputStream out) { in Tunnel() argument
79 tin = in; in Tunnel()
105 in = new BufferedInputStream(client.getInputStream()); in ClientHandler()
123 int ver = in.read(); in userPassAuth()
124 int ulen = in.read(); in userPassAuth()
128 readBuf(in, buf); in userPassAuth()
131 ulen = in.read(); in userPassAuth()
136 readBuf(in, buf); in userPassAuth()
164 i = in.read(); in purge()
[all …]
/libcore/ojluni/src/test/java/io/Reader/
DTransferTo.java49 try (Reader in = input()) { in ifOutIsNullThenNpeIsThrown() argument
50 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
53 try (Reader in = input((char) 1)) { in ifOutIsNullThenNpeIsThrown() argument
54 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
57 try (Reader in = input((char) 1, (char) 2)) { in ifOutIsNullThenNpeIsThrown() argument
58 assertThrowsNPE(() -> in.transferTo(null), "out"); in ifOutIsNullThenNpeIsThrown()
61 Reader in = null; in ifOutIsNullThenNpeIsThrown() local
63 Reader fin = in = new ThrowingReader(); in ifOutIsNullThenNpeIsThrown()
68 if (in != null) in ifOutIsNullThenNpeIsThrown()
70 in.close(); in ifOutIsNullThenNpeIsThrown()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DFilterInputStreamNullSourceTest.java49 InputStream in = new CipherInputStream(null, new NullCipher()); in testCipherInputStream() local
51 in.read(); in testCipherInputStream()
56 assertEquals(0, in.available()); in testCipherInputStream()
59 in.close(); in testCipherInputStream()
105 private void assertReadsFailWithIoException(InputStream in) throws IOException { in assertReadsFailWithIoException() argument
107 in.read(); in assertReadsFailWithIoException()
113 in.available(); in assertReadsFailWithIoException()
118 in.close(); in assertReadsFailWithIoException()
121 private void assertReadsFailWithNullPointerException(InputStream in) throws IOException { in assertReadsFailWithNullPointerException() argument
123 in.read(); in assertReadsFailWithNullPointerException()
[all …]

12345678910>>...21