Home
last modified time | relevance | path

Searched refs:position (Results 1 – 25 of 161) sorted by relevance

1234567

/libcore/ojluni/src/main/java/java/nio/channels/
DFileLock.java122 private final long position; field in FileLock
148 long position, long size, boolean shared) in FileLock() argument
150 if (position < 0) in FileLock()
154 if (position + size < 0) in FileLock()
157 this.position = position; in FileLock()
186 long position, long size, boolean shared) in FileLock() argument
188 if (position < 0) in FileLock()
192 if (position + size < 0) in FileLock()
195 this.position = position; in FileLock()
234 public final long position() { in position() method in FileLock
[all …]
/libcore/ojluni/src/main/java/java/nio/
DBuffer.java188 int position = 0; field in Buffer
214 position(pos); in Buffer()
239 public final int position() { in position() method in Buffer
240 return position; in position()
256 public Buffer position(int newPosition) { in position() method in Buffer
260 position = newPosition; in position()
261 if (mark > position) mark = -1; in position()
292 if (position > limit) position = limit; in limit()
303 mark = position; in mark()
322 position = m; in reset()
[all …]
DHeapIntBuffer.java81 this.position() + offset, in slice()
88 this.position(), in duplicate()
99 this.position(), in asReadOnlyBuffer()
121 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
122 position(position() + length); in get()
157 System.arraycopy(src, offset, hb, ix(position()), length); in put()
158 position(position() + length); in put()
174 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
175 hb, ix(position()), n); in put()
176 sb.position(sb.position() + n); in put()
[all …]
DHeapLongBuffer.java82 this.position() + offset, in slice()
89 this.position(), in duplicate()
99 this.position(), in asReadOnlyBuffer()
122 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
123 position(position() + length); in get()
158 System.arraycopy(src, offset, hb, ix(position()), length); in put()
159 position(position() + length); in put()
175 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
176 hb, ix(position()), n); in put()
177 sb.position(sb.position() + n); in put()
[all …]
DHeapDoubleBuffer.java82 this.position() + offset, in slice()
89 this.position(), in duplicate()
99 this.position(), in asReadOnlyBuffer()
121 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
122 position(position() + length); in get()
157 System.arraycopy(src, offset, hb, ix(position()), length); in put()
158 position(position() + length); in put()
174 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
175 hb, ix(position()), n); in put()
176 sb.position(sb.position() + n); in put()
[all …]
DHeapFloatBuffer.java81 this.position() + offset, in slice()
88 this.position(), in duplicate()
98 this.position(), in asReadOnlyBuffer()
120 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
121 position(position() + length); in get()
156 System.arraycopy(src, offset, hb, ix(position()), length); in put()
157 position(position() + length); in put()
173 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
174 hb, ix(position()), n); in put()
175 sb.position(sb.position() + n); in put()
[all …]
DHeapShortBuffer.java81 this.position() + offset, in slice()
88 this.position(), in duplicate()
99 this.position(), in asReadOnlyBuffer()
121 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
122 position(position() + length); in get()
157 System.arraycopy(src, offset, hb, ix(position()), length); in put()
158 position(position() + length); in put()
174 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
175 hb, ix(position()), n); in put()
176 sb.position(sb.position() + n); in put()
[all …]
DHeapCharBuffer.java81 this.position() + offset, in slice()
88 this.position(), in duplicate()
99 this.position(), in asReadOnlyBuffer()
126 System.arraycopy(hb, ix(position()), dst, offset, length); in get()
127 position(position() + length); in get()
162 System.arraycopy(src, offset, hb, ix(position()), length); in put()
163 position(position() + length); in put()
179 System.arraycopy(sb.hb, sb.ix(sb.position()), in put()
180 hb, ix(position()), n); in put()
181 sb.position(sb.position() + n); in put()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DAbstractBufferTest.java42 assertTrue(0 <= baseBuf.position() && baseBuf.position() <= baseBuf.limit() in testCapacity()
48 int oldPosition = baseBuf.position(); in testClear()
53 assertEquals(baseBuf.position(), 0); in testClear()
64 baseBuf.position(oldPosition); in testClear()
69 int oldPosition = baseBuf.position(); in testFlip()
74 assertEquals(baseBuf.position(), 0); in testFlip()
85 baseBuf.position(oldPosition); in testFlip()
90 int oldPosition = baseBuf.position(); in testHasRemaining()
93 assertEquals(baseBuf.hasRemaining(), baseBuf.position() < baseBuf.limit()); in testHasRemaining()
94 baseBuf.position(baseBuf.limit()); in testHasRemaining()
[all …]
DFloatBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
93 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
101 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
105 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
116 assertEquals(buf.position(), buf.capacity()); in testCompact()
127 buf.position(0); in testCompact()
132 assertEquals(buf.position(), 0); in testCompact()
144 buf.position(1); in testCompact()
149 assertEquals(buf.position(), 4); in testCompact()
[all …]
DLongBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
93 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
101 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
105 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
115 assertEquals(buf.position(), buf.capacity()); in testCompact()
126 buf.position(0); in testCompact()
131 assertEquals(buf.position(), 0); in testCompact()
143 buf.position(1); in testCompact()
148 assertEquals(buf.position(), 4); in testCompact()
[all …]
DShortBufferTest.java86 buf.position(buf.limit()); in testAsReadOnlyBuffer()
92 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
100 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
102 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
104 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
114 assertEquals(buf.position(), buf.capacity()); in testCompact()
125 buf.position(0); in testCompact()
130 assertEquals(buf.position(), 0); in testCompact()
142 buf.position(1); in testCompact()
147 assertEquals(buf.position(), 4); in testCompact()
[all …]
DIntBufferTest.java87 buf.position(buf.limit()); in testAsReadOnlyBuffer()
93 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
101 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
103 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
105 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
115 assertEquals(buf.position(), buf.capacity()); in testCompact()
126 buf.position(0); in testCompact()
131 assertEquals(buf.position(), 0); in testCompact()
143 buf.position(1); in testCompact()
148 assertEquals(buf.position(), 4); in testCompact()
[all …]
DDoubleBufferTest.java111 buf.position(buf.limit()); in testAsReadOnlyBuffer()
117 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
125 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
127 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
129 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
139 assertEquals(buf.position(), buf.capacity()); in testCompact()
150 buf.position(0); in testCompact()
155 assertEquals(buf.position(), 0); in testCompact()
167 buf.position(1); in testCompact()
172 assertEquals(buf.position(), 4); in testCompact()
[all …]
DCharBufferTest.java90 buf.position(buf.limit()); in testAsReadOnlyBuffer()
96 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
105 assertEquals(readonly.position(), 0); in testAsReadOnlyBuffer()
107 assertEquals(buf.position(), buf.limit()); in testAsReadOnlyBuffer()
109 assertEquals(buf.position(), 0); in testAsReadOnlyBuffer()
112 int originalPosition = (buf.position() + buf.limit()) / 2; in testAsReadOnlyBuffer()
113 buf.position(originalPosition); in testAsReadOnlyBuffer()
115 buf.position(buf.limit()); in testAsReadOnlyBuffer()
121 assertEquals(buf.position(), readonly.position()); in testAsReadOnlyBuffer()
130 assertEquals(readonly.position(), originalPosition); in testAsReadOnlyBuffer()
[all …]
/libcore/luni/src/main/java/libcore/io/
DNioBufferIterator.java32 private int position; field in NioBufferIterator
54 position = offset; in seek()
58 position += byteCount; in skip()
63 return position; in pos()
69 checkReadBounds(position, length, byteCount); in readByteArray()
70 Memory.peekByteArray(address + position, dst, dstOffset, byteCount); in readByteArray()
71 position += byteCount; in readByteArray()
76 checkReadBounds(position, length, 1); in readByte()
77 byte result = Memory.peekByte(address + position); in readByte()
78 ++position; in readByte()
[all …]
/libcore/luni/src/test/resources/out_dh/
Dstaff.out45position$position^$salary$salary^$gender$gender^$address$address^$employee$employee^$employeeId$em…
/libcore/ojluni/src/main/java/java/util/
DStringTokenizer.java248 int position = startPos; in skipDelimiters() local
249 while (!retDelims && position < maxPosition) { in skipDelimiters()
251 char c = str.charAt(position); in skipDelimiters()
254 position++; in skipDelimiters()
256 int c = str.codePointAt(position); in skipDelimiters()
260 position += Character.charCount(c); in skipDelimiters()
263 return position; in skipDelimiters()
271 int position = startPos; in scanToken() local
272 while (position < maxPosition) { in scanToken()
274 char c = str.charAt(position); in scanToken()
[all …]
/libcore/xml/src/main/java/com/android/org/kxml2/io/
DKXmlParser.java143 private int position = 0; field in KXmlParser
467 int start = position; in readUntil()
477 if (position + delimiter.length > limit) { in readUntil()
478 if (start < position && returnText) { in readUntil()
482 result.append(buffer, start, position - start); in readUntil()
489 start = position; in readUntil()
495 if (buffer[position + i] != delimiter[i]) { in readUntil()
496 position++; in readUntil()
504 int end = position; in readUntil()
505 position += delimiter.length; in readUntil()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DAsynchronousFileChannelImpl.java106 abstract <A> Future<FileLock> implLock(long position, in implLock() argument
113 public final Future<FileLock> lock(long position, in lock() argument
118 return implLock(position, size, shared, null, null); in lock()
122 public final <A> void lock(long position, in lock() argument
130 implLock(position, size, shared, attachment, handler); in lock()
162 protected final FileLockImpl addToFileLockTable(long position, long size, boolean shared) { in addToFileLockTable() argument
176 fli = new FileLockImpl(this, position, size, shared); in addToFileLockTable()
212 long position, in implRead() argument
217 public final Future<Integer> read(ByteBuffer dst, long position) { in read() argument
218 return implRead(dst, position, null, null); in read()
[all …]
DIOUtil.java46 static int write(FileDescriptor fd, ByteBuffer src, long position, in write() argument
51 return writeFromNativeBuffer(fd, src, position, nd); in write()
54 int pos = src.position(); in write()
63 src.position(pos); in write()
65 int n = writeFromNativeBuffer(fd, bb, position, nd); in write()
68 src.position(pos + n); in write()
77 long position, NativeDispatcher nd) in writeFromNativeBuffer() argument
80 int pos = bb.position(); in writeFromNativeBuffer()
88 if (position != -1) { in writeFromNativeBuffer()
91 rem, position); in writeFromNativeBuffer()
[all …]
DFileChannelImpl.java147 nd.release(fd, fl.position(), fl.size()); in implCloseChannel()
290 public long position() throws IOException { in position() method in FileChannelImpl
320 public FileChannel position(long newPosition) throws IOException { in position() method in FileChannelImpl
461 private long transferToDirectlyInternal(long position, int icount, in transferToDirectlyInternal() argument
479 n = transferTo0(fd, position, icount, targetFD); in transferToDirectlyInternal()
500 private long transferToDirectly(long position, int icount, in transferToDirectly() argument
535 long pos = position(); in transferToDirectly()
537 return transferToDirectlyInternal(position, icount, in transferToDirectly()
540 position(pos); in transferToDirectly()
544 return transferToDirectlyInternal(position, icount, target, targetFD); in transferToDirectly()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/
DOldAndroidNIOTest.java35 assertTrue(0 <= b.position()); in checkBuffer()
36 assertTrue(b.position() <= b.limit()); in checkBuffer()
98 b.position(0); in byteBufferTest()
108 b.position(0); in byteBufferTest()
118 b.position(b.limit() - 2); in byteBufferTest()
126 b.position(0); in byteBufferTest()
137 b.position(0); in byteBufferTest()
152 b.position(0); in byteBufferTest()
173 b.position(0); in byteBufferTest()
194 b.position(6); in byteBufferTest()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_OutputStream.java19 private int position; field in Support_OutputStream
36 position = 0; in Support_OutputStream()
85 if (position < size) { in write()
86 buffer[position] = (byte)(oneByte & 255); in write()
87 position++; in write()
94 byte[] toReturn = new byte[position]; in toByteArray()
95 System.arraycopy(buffer, 0, toReturn, 0, position); in toByteArray()
100 return new String(buffer, 0, position); in toString()
104 return position; in size()
/libcore/benchmarks/src/benchmarks/regression/
DByteBufferBenchmark.java76 result.position(aligned ? 0 : 1); in newBuffer()
87 src.position(aligned ? 0 : 1); in timeByteBuffer_getByte()
99 src.position(aligned ? 0 : 1); in timeByteBuffer_getByteArray()
108 src.position(aligned ? 0 : 1); in timeByteBuffer_getByte_indexed()
118 src.position(aligned ? 0 : 1); in timeByteBuffer_getChar()
130 src.position(0); in timeCharBuffer_getCharArray()
139 src.position(aligned ? 0 : 1); in timeByteBuffer_getChar_indexed()
149 src.position(aligned ? 0 : 1); in timeByteBuffer_getDouble()
161 src.position(0); in timeDoubleBuffer_getDoubleArray()
170 src.position(aligned ? 0 : 1); in timeByteBuffer_getFloat()
[all …]

1234567