Home
last modified time | relevance | path

Searched refs:pos (Results 1 – 25 of 173) sorted by relevance

1234567

/libcore/ojluni/src/main/java/java/text/
DStringCharacterIterator.java58 private int pos; field in StringCharacterIterator
76 public StringCharacterIterator(String text, int pos) in StringCharacterIterator() argument
78 this(text, 0, text.length(), pos); in StringCharacterIterator()
90 public StringCharacterIterator(String text, int begin, int end, int pos) { in StringCharacterIterator() argument
98 if (pos < begin || pos > end) in StringCharacterIterator()
103 this.pos = pos; in StringCharacterIterator()
121 this.pos = 0; in setText()
130 pos = begin; in first()
141 pos = end - 1; in last()
143 pos = end; in last()
[all …]
/libcore/json/src/main/java/org/json/
DJSONTokener.java75 private int pos; field in JSONTokener
114 pos--; in nextValue()
121 while (pos < in.length()) { in nextCleanInternal()
122 int c = in.charAt(pos++); in nextCleanInternal()
131 if (pos == in.length()) { in nextCleanInternal()
135 char peek = in.charAt(pos); in nextCleanInternal()
139 pos++; in nextCleanInternal()
140 int commentEnd = in.indexOf("*/", pos); in nextCleanInternal()
144 pos = commentEnd + 2; in nextCleanInternal()
149 pos++; in nextCleanInternal()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestZoneOffsetParser.java89 …public void test_parse_error(String pattern, String noOffsetText, String text, int pos, Class<?> e… in test_parse_error() argument
91 getFormatter(pattern, noOffsetText).parseUnresolved(text, new ParsePosition(pos)); in test_parse_error()
99 ParsePosition pos = new ParsePosition(0); in test_parse_exactMatch_UTC() local
100 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("Z", pos); in test_parse_exactMatch_UTC()
101 assertEquals(pos.getIndex(), 1); in test_parse_exactMatch_UTC()
106 ParsePosition pos = new ParsePosition(0); in test_parse_startStringMatch_UTC() local
107 TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("ZOTHER", pos); in test_parse_startStringMatch_UTC()
108 assertEquals(pos.getIndex(), 1); in test_parse_startStringMatch_UTC()
113 ParsePosition pos = new ParsePosition(5); in test_parse_midStringMatch_UTC() local
114 … TemporalAccessor parsed = getFormatter("+HH:MM:ss", "Z").parseUnresolved("OTHERZOTHER", pos); in test_parse_midStringMatch_UTC()
[all …]
DTestTextParser.java98 …public void test_parse_error(TemporalField field, TextStyle style, String text, int pos, Class<?> … in test_parse_error() argument
100 getFormatter(field, style).parseUnresolved(text, new ParsePosition(pos)); in test_parse_error()
108 ParsePosition pos = new ParsePosition(3); in test_parse_midStr() local
110 .parseUnresolved("XxxMondayXxx", pos) in test_parse_midStr()
112 assertEquals(pos.getIndex(), 9); in test_parse_midStr()
116 ParsePosition pos = new ParsePosition(0); in test_parse_remainderIgnored() local
118 .parseUnresolved("Wednesday", pos) in test_parse_remainderIgnored()
120 assertEquals(pos.getIndex(), 3); in test_parse_remainderIgnored()
125 ParsePosition pos = new ParsePosition(0); in test_parse_noMatch1() local
127 getFormatter(DAY_OF_WEEK, TextStyle.FULL).parseUnresolved("Munday", pos); in test_parse_noMatch1()
[all …]
DTestSettingsParser.java97 ParsePosition pos = new ParsePosition(0); in test_parse_changeStyle_sensitive() local
98 getFormatter().parseUnresolved("a", pos); in test_parse_changeStyle_sensitive()
99 assertEquals(pos.getIndex(), 0); in test_parse_changeStyle_sensitive()
104 ParsePosition pos = new ParsePosition(0); in test_parse_changeStyle_insensitive() local
105 getFormatter().parseUnresolved("a", pos); in test_parse_changeStyle_insensitive()
106 assertEquals(pos.getIndex(), 0); in test_parse_changeStyle_insensitive()
111 ParsePosition pos = new ParsePosition(0); in test_parse_changeStyle_strict() local
112 getFormatter().parseUnresolved("a", pos); in test_parse_changeStyle_strict()
113 assertEquals(pos.getIndex(), 0); in test_parse_changeStyle_strict()
118 ParsePosition pos = new ParsePosition(0); in test_parse_changeStyle_lenient() local
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DDerInputBuffer.java70 System.arraycopy(buf, pos, retval, 0, len); in toByteArray()
76 return pos; in getPos()
87 if (pos >= count) in peek()
90 return buf[pos]; in peek()
112 if (this.buf[this.pos + i] != other.buf[other.pos + i]) { in equals()
128 int p = pos; in hashCode()
138 count = pos + len; in truncate()
159 System.arraycopy(buf, pos, bytes, 0, len); in getBigInteger()
207 int numOfPadBits = buf[pos]; in getBitString()
213 System.arraycopy(buf, pos + 1, retval, 0, len - 1); in getBitString()
[all …]
DManifestDigester.java66 private boolean findSection(int offset, Position pos) in findSection() argument
73 pos.endOfFirstLine = -1; in findSection()
79 if (pos.endOfFirstLine == -1) in findSection()
80 pos.endOfFirstLine = i-1; in findSection()
85 if (pos.endOfFirstLine == -1) in findSection()
86 pos.endOfFirstLine = i-1; in findSection()
89 pos.endOfSection = i; in findSection()
91 pos.endOfSection = last; in findSection()
92 pos.startOfNext = i+1; in findSection()
117 Position pos = new Position(); in ManifestDigester() local
[all …]
/libcore/ojluni/src/main/java/java/io/
DBufferedInputStream.java109 protected int pos; field in BufferedInputStream
218 pos = 0; /* no mark: throw away the buffer */ in fill()
219 else if (pos >= buffer.length) /* no room left in buffer */ in fill()
221 int sz = pos - markpos; in fill()
223 pos = sz; in fill()
227 pos = 0; /* drop buffer contents */ in fill()
231 int nsz = (pos <= MAX_BUFFER_SIZE - pos) ? in fill()
232 pos * 2 : MAX_BUFFER_SIZE; in fill()
236 System.arraycopy(buffer, 0, nbuf, 0, pos); in fill()
247 count = pos; in fill()
[all …]
DByteArrayInputStream.java63 protected int pos; field in ByteArrayInputStream
105 this.pos = 0; in ByteArrayInputStream()
125 this.pos = offset; in ByteArrayInputStream()
144 return (pos < count) ? (buf[pos++] & 0xff) : -1; in read()
183 if (pos >= count) { in read()
187 int avail = count - pos; in read()
194 System.arraycopy(buf, pos, b, off, len); in read()
195 pos += len; in read()
212 long k = count - pos; in skip()
217 pos += k; in skip()
[all …]
DCharArrayReader.java40 protected int pos; field in CharArrayReader
57 this.pos = 0; in CharArrayReader()
84 this.pos = offset; in CharArrayReader()
103 if (pos >= count) in read()
106 return buf[pos++]; in read()
130 if (pos >= count) { in read()
134 int avail = count - pos; in read()
142 System.arraycopy(buf, pos, b, off, len); in read()
143 pos += len; in read()
164 long avail = count - pos; in skip()
[all …]
DPushbackReader.java43 private int pos; field in PushbackReader
58 this.pos = size; in PushbackReader()
87 if (pos < buf.length) in read()
88 return buf[pos++]; in read()
118 int avail = buf.length - pos; in read()
122 System.arraycopy(buf, pos, cbuf, off, avail); in read()
123 pos += avail; in read()
154 if (pos == 0) in unread()
156 buf[--pos] = (char) c; in unread()
177 if (len > pos) in unread()
[all …]
DStringBufferInputStream.java58 protected int pos; field in StringBufferInputStream
92 return (pos < count) ? (buffer.charAt(pos++) & 0xFF) : -1; in read()
118 if (pos >= count) { in read()
122 int avail = count - pos; in read()
133 b[off++] = (byte)s.charAt(pos++); in read()
150 if (n > count - pos) { in skip()
151 n = count - pos; in skip()
153 pos += n; in skip()
165 return count - pos; in available()
173 pos = 0; in reset()
DPushbackInputStream.java67 protected int pos; field in PushbackInputStream
97 this.pos = size; in PushbackInputStream()
136 if (pos < buf.length) { in read()
137 return buf[pos++] & 0xff; in read()
175 int avail = buf.length - pos; in read()
180 System.arraycopy(buf, pos, b, off, avail); in read()
181 pos += avail; in read()
208 if (pos == 0) { in unread()
211 buf[--pos] = (byte)b; in unread()
231 if (len > pos) { in unread()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_StringReader.java28 private int pos = 0; field in Support_StringReader
84 markpos = pos; in mark()
121 if (pos != count) { in read()
122 return str.charAt(pos++); in read()
154 if (pos == this.count) { in read()
157 int end = pos + count > this.count ? this.count : pos in read()
159 str.getChars(pos, end, buf, offset); in read()
160 int read = end - pos; in read()
161 pos = end; in read()
208 pos = markpos != -1 ? markpos : 0; in reset()
[all …]
DSupport_ASimpleOutputStream.java18 public int pos; field in Support_ASimpleOutputStream
36 pos = 0; in Support_ASimpleOutputStream()
82 if (pos < size) { in write()
83 buf[pos] = (byte)(oneByte & 255); in write()
84 pos++; in write()
91 byte[] toReturn = new byte[pos]; in toByteArray()
92 System.arraycopy(buf, 0, toReturn, 0, pos); in toByteArray()
97 return new String(buf, 0, pos); in toString()
/libcore/ojluni/src/main/java/sun/nio/ch/
DIOUtil.java54 int pos = src.position(); in write() local
56 assert (pos <= lim); in write()
57 int rem = (pos <= lim ? lim - pos : 0); in write()
63 src.position(pos); in write()
68 src.position(pos + n); in write()
80 int pos = bb.position(); in writeFromNativeBuffer() local
82 assert (pos <= lim); in writeFromNativeBuffer()
83 int rem = (pos <= lim ? lim - pos : 0); in writeFromNativeBuffer()
90 ((DirectBuffer)bb).address() + pos, in writeFromNativeBuffer()
93 written = nd.write(fd, ((DirectBuffer)bb).address() + pos, rem); in writeFromNativeBuffer()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DPipedInputStreamTest.java27 PipedOutputStream pos; field in PipedInputStreamTest.PWriter
33 pos.write(bytes); in run()
44 pos = pout; in PWriter()
58 PipedOutputStream pos; field in PipedInputStreamTest
80 pos = new PipedOutputStream(); in test_readException()
83 pis.connect(pos); in test_readException()
84 t = new Thread(pw = new PWriter(pos, 1000)); in test_readException()
94 pos.close(); in test_readException()
105 pos = new PipedOutputStream(); in test_available()
107 pis.connect(pos); in test_available()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineResultTest.java95 int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) }; in test_bytesConsumed() local
102 for (int n = 0; n < pos.length; n++) { in test_bytesConsumed()
103 for (int l = 0; l < pos.length; l++) { in test_bytesConsumed()
105 enHS[j], pos[n], pos[l]); in test_bytesConsumed()
106 assertEquals("Incorrect bytesConsumed", pos[n], in test_bytesConsumed()
118 int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) }; in test_bytesProduced() local
125 for (int n = 0; n < pos.length; n++) { in test_bytesProduced()
126 for (int l = 0; l < pos.length; ++l) { in test_bytesProduced()
128 enHS[j], pos[n], pos[l]); in test_bytesProduced()
129 assertEquals("Incorrect bytesProduced", pos[l], in test_bytesProduced()
[all …]
/libcore/ojluni/src/main/java/java/nio/
DByteBufferAsCharBuffer.java37 int mark, int pos, int lim, int cap, in ByteBufferAsCharBuffer() argument
39 super(mark, pos, lim, cap); in ByteBufferAsCharBuffer()
58 int pos = this.position(); in slice() local
60 assert (pos <= lim); in slice()
61 int rem = (pos <= lim ? lim - pos : 0); in slice()
62 int off = (pos << 1) + offset; in slice()
138 int pos = position(); in compact() local
140 assert (pos <= lim); in compact()
141 int rem = (pos <= lim ? lim - pos : 0); in compact()
143 System.arraycopy(bb.array(), ix(pos), bb.array(), ix(0), rem << 1); in compact()
[all …]
DByteBufferAsFloatBuffer.java37 int mark, int pos, int lim, int cap, in ByteBufferAsFloatBuffer() argument
39 super(mark, pos, lim, cap); in ByteBufferAsFloatBuffer()
58 int pos = this.position(); in slice() local
60 assert (pos <= lim); in slice()
61 int rem = (pos <= lim ? lim - pos : 0); in slice()
62 int off = (pos << 2) + offset; in slice()
134 int pos = position(); in compact() local
136 assert (pos <= lim); in compact()
137 int rem = (pos <= lim ? lim - pos : 0); in compact()
139 System.arraycopy(bb.array(), ix(pos), bb.array(), ix(0), rem << 2); in compact()
[all …]
DByteBufferAsLongBuffer.java37 int mark, int pos, int lim, int cap, in ByteBufferAsLongBuffer() argument
39 super(mark, pos, lim, cap); in ByteBufferAsLongBuffer()
58 int pos = this.position(); in slice() local
60 assert (pos <= lim); in slice()
61 int rem = (pos <= lim ? lim - pos : 0); in slice()
62 int off = (pos << 3) + offset; in slice()
134 int pos = position(); in compact() local
136 assert (pos <= lim); in compact()
137 int rem = (pos <= lim ? lim - pos : 0); in compact()
139 System.arraycopy(bb.array(), ix(pos), bb.array(), ix(0), rem << 3); in compact()
[all …]
DByteBufferAsIntBuffer.java37 int mark, int pos, int lim, int cap, in ByteBufferAsIntBuffer() argument
39 super(mark, pos, lim, cap); in ByteBufferAsIntBuffer()
58 int pos = this.position(); in slice() local
60 assert (pos <= lim); in slice()
61 int rem = (pos <= lim ? lim - pos : 0); in slice()
62 int off = (pos << 2) + offset; in slice()
134 int pos = position(); in compact() local
136 assert (pos <= lim); in compact()
137 int rem = (pos <= lim ? lim - pos : 0); in compact()
139 System.arraycopy(bb.array(), ix(pos), bb.array(), ix(0), rem << 2); in compact()
[all …]
/libcore/ojluni/src/main/java/sun/misc/
DIOUtils.java54 int pos = 0; in readFully() local
55 while (pos < length) { in readFully()
57 if (pos >= output.length) { // Only expand when there's no room in readFully()
58 bytesToRead = Math.min(length - pos, output.length + 1024); in readFully()
59 if (output.length < pos + bytesToRead) { in readFully()
60 output = Arrays.copyOf(output, pos + bytesToRead); in readFully()
63 bytesToRead = output.length - pos; in readFully()
65 int cc = is.read(output, pos, bytesToRead); in readFully()
70 if (output.length != pos) { in readFully()
71 output = Arrays.copyOf(output, pos); in readFully()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKPadPrinterParser.java83 private ParsePosition pos; field in TCKPadPrinterParser
88 pos = new ParsePosition(0); in setUp()
132 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseStrict()
133 assertEquals(pos.getIndex(), expectedIndex); in test_parseStrict()
134 assertEquals(pos.getErrorIndex(), expectedErrorIndex); in test_parseStrict()
173 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseLenient()
174 assertEquals(pos.getIndex(), expectedIndex); in test_parseLenient()
175 assertEquals(pos.getErrorIndex(), expectedErrorIndex); in test_parseLenient()
188 TemporalAccessor parsed = builder.toFormatter().parseUnresolved("--HELLO-", pos); in test_parse_decoratedStartsWithPad()
189 assertEquals(pos.getIndex(), 0); in test_parse_decoratedStartsWithPad()
[all …]
DTCKChronoPrinterParser.java87 private ParsePosition pos; field in TCKChronoPrinterParser
92 pos = new ParsePosition(0); in setUp()
123 TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); in test_parseValid_caseSensitive()
124 assertEquals(pos.getIndex(), expected.getId().length()); in test_parseValid_caseSensitive()
125 assertEquals(pos.getErrorIndex(), -1); in test_parseValid_caseSensitive()
132 …oralAccessor parsed = builder.toFormatter().parseUnresolved(text.toLowerCase(Locale.ENGLISH), pos); in test_parseValid_caseSensitive_lowercaseRejected()
133 assertEquals(pos.getIndex(), 0); in test_parseValid_caseSensitive_lowercaseRejected()
134 assertEquals(pos.getErrorIndex(), 0); in test_parseValid_caseSensitive_lowercaseRejected()
141 …oralAccessor parsed = builder.toFormatter().parseUnresolved(text.toLowerCase(Locale.ENGLISH), pos); in test_parseValid_caseInsensitive()
142 assertEquals(pos.getIndex(), expected.getId().length()); in test_parseValid_caseInsensitive()
[all …]

1234567