/libcore/ojluni/src/main/java/java/io/ |
D | Bits.java | 39 static boolean getBoolean(byte[] b, int off) { in getBoolean() argument 40 return b[off] != 0; in getBoolean() 43 static char getChar(byte[] b, int off) { in getChar() argument 44 return (char) ((b[off + 1] & 0xFF) + in getChar() 45 (b[off] << 8)); in getChar() 48 static short getShort(byte[] b, int off) { in getShort() argument 49 return (short) ((b[off + 1] & 0xFF) + in getShort() 50 (b[off] << 8)); in getShort() 53 static int getInt(byte[] b, int off) { in getInt() argument 54 return ((b[off + 3] & 0xFF) ) + in getInt() [all …]
|
D | ObjectInputStream.java | 917 public int read(byte[] buf, int off, int len) throws IOException { in read() argument 921 int endoff = off + len; in read() 922 if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { in read() 925 return bin.read(buf, off, len, false); in read() 1087 public void readFully(byte[] buf, int off, int len) throws IOException { in readFully() argument 1088 int endoff = off + len; in readFully() 1089 if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { in readFully() 1092 bin.readFully(buf, off, len, false); in readFully() 2322 int off = getFieldOffset(name, Boolean.TYPE); in get() local 2323 return (off >= 0) ? Bits.getBoolean(primValues, off) : val; in get() [all …]
|
D | StringWriter.java | 92 public void write(char cbuf[], int off, int len) { in write() argument 93 if ((off < 0) || (off > cbuf.length) || (len < 0) || in write() 94 ((off + len) > cbuf.length) || ((off + len) < 0)) { in write() 99 buf.append(cbuf, off, len); in write() 121 public void write(String str, int off, int len) { in write() argument 122 buf.append(str, off, off + len); in write()
|
D | BufferedWriter.java | 169 public void write(char cbuf[], int off, int len) throws IOException { in write() argument 172 if ((off < 0) || (off > cbuf.length) || (len < 0) || in write() 173 ((off + len) > cbuf.length) || ((off + len) < 0)) { in write() 184 out.write(cbuf, off, len); in write() 188 int b = off, t = off + len; in write() 222 public void write(String s, int off, int len) throws IOException { in write() argument 226 int b = off, t = off + len; in write()
|
D | ObjectOutputStream.java | 723 public void write(byte[] buf, int off, int len) throws IOException { in write() argument 727 int endoff = off + len; in write() 728 if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { in write() 731 bout.write(buf, off, len, false); in write() 1923 public void write(byte[] b, int off, int len) throws IOException { in write() argument 1924 write(b, off, len, false); in write() 1945 void write(byte[] b, int off, int len, boolean copy) in write() argument 1950 out.write(b, off, len); in write() 1963 out.write(b, off, MAX_BLOCK_SIZE); in write() 1964 off += MAX_BLOCK_SIZE; in write() [all …]
|
D | CharArrayWriter.java | 100 public void write(char c[], int off, int len) { in write() argument 101 if ((off < 0) || (off > c.length) || (len < 0) || in write() 102 ((off + len) > c.length) || ((off + len) < 0)) { in write() 112 System.arraycopy(c, off, buf, count, len); in write() 128 public void write(String str, int off, int len) { in write() argument 134 str.getChars(off, off + len, buf, count); in write()
|
D | StringBufferInputStream.java | 112 public synchronized int read(byte b[], int off, int len) { in read() argument 115 } else if ((off < 0) || (off > b.length) || (len < 0) || in read() 116 ((off + len) > b.length) || ((off + len) < 0)) { in read() 131 buffer.getBytes(pos, pos + len, b, off); in read()
|
/libcore/ojluni/src/main/java/java/util/zip/ |
D | CRC32C.java | 147 public void update(byte[] b, int off, int len) { in update() argument 151 if (off < 0 || len < 0 || off > b.length - len) { in update() 154 crc = updateBytes(crc, b, off, (off + len)); in update() 215 private static int updateBytes(int crc, byte[] b, int off, int end) { in updateBytes() argument 219 if (end - off >= 8 && Unsafe.ARRAY_BYTE_INDEX_SCALE == 1) { in updateBytes() 223 = (8 - ((Unsafe.ARRAY_BYTE_BASE_OFFSET + off) & 0x7)) & 0x7; in updateBytes() 224 for (int alignEnd = off + alignLength; off < alignEnd; off++) { in updateBytes() 225 crc = (crc >>> 8) ^ byteTable[(crc ^ b[off]) & 0xFF]; in updateBytes() 233 for (; off < (end - Long.BYTES); off += Long.BYTES) { in updateBytes() 238 firstHalf = UNSAFE.getInt(b, (long)Unsafe.ARRAY_BYTE_BASE_OFFSET + off); in updateBytes() [all …]
|
D | CRC32.java | 73 public void update(byte[] b, int off, int len) { in update() argument 77 if (off < 0 || len < 0 || off > b.length - len) { in update() 80 crc = updateBytes(crc, b, off, len); in update() 150 private static int updateBytes(int crc, byte[] b, int off, int len) { in updateBytes() argument 151 updateBytesCheck(b, off, len); in updateBytes() 152 return updateBytes0(crc, b, off, len); in updateBytes() 156 private static native int updateBytes0(int crc, byte[] b, int off, int len); in updateBytes0() argument 158 private static void updateBytesCheck(byte[] b, int off, int len) { in updateBytesCheck() argument 165 if (off < 0 || off >= b.length) { in updateBytesCheck() 166 throw new ArrayIndexOutOfBoundsException(off); in updateBytesCheck() [all …]
|
D | ZipFile.java | 933 int off = cenpos + CENHDR + CENNAM(cen, cenpos); in checkZIP64() local 934 int end = off + CENEXT(cen, cenpos); in checkZIP64() 935 while (off + 4 < end) { in checkZIP64() 936 int tag = get16(cen, off); in checkZIP64() 937 int sz = get16(cen, off + 2); in checkZIP64() 938 off += 4; in checkZIP64() 939 if (off + sz > end) // invalid data in checkZIP64() 943 if (sz < 8 || (off + 8) > end) in checkZIP64() 945 size = get64(cen, off); in checkZIP64() 947 off += 8; in checkZIP64() [all …]
|
D | ZipOutputStream.java | 334 public synchronized void write(byte[] b, int off, int len) in write() argument 338 if (off < 0 || len < 0 || off > b.length - len) { in write() 349 case DEFLATED -> super.write(b, off, len); in write() 356 out.write(b, off, len); in write() 360 crc.update(b, off, len); in write() 379 long off = written; in finish() local 382 writeEND(off, written - off); in finish() 677 private void writeEND(long off, long len) throws IOException { in writeEND() argument 680 long xoff = off; in writeEND() 708 writeLong(off); // offset of central directory in writeEND() [all …]
|
D | ZipEntry.java | 592 int off = 0; in setExtra0() local 594 while (off + 4 < len) { in setExtra0() 595 int tag = get16(extra, off); in setExtra0() 596 int sz = get16(extra, off + 2); in setExtra0() 597 off += 4; in setExtra0() 598 if (off + sz > len) // invalid data in setExtra0() 611 size = get64(extra, off); in setExtra0() 612 csize = get64(extra, off + 8); in setExtra0() 617 if (off + 8 > len) // invalid zip64 extra in setExtra0() 619 size = get64(extra, off); in setExtra0() [all …]
|
/libcore/ojluni/src/main/java/java/nio/ |
D | ByteBufferAsLongBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsLongBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsLongBuffer() 79 byteOffset = off; in ByteBufferAsLongBuffer() 177 public LongBuffer get(long[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public LongBuffer get(int index, long[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public LongBuffer put(long[] src, int off, int length) { in put() argument [all …]
|
D | ByteBufferAsIntBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsIntBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsIntBuffer() 79 byteOffset = off; in ByteBufferAsIntBuffer() 177 public IntBuffer get(int[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public IntBuffer get(int index, int[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public IntBuffer put(int[] src, int off, int length) { in put() argument [all …]
|
D | ByteBufferAsDoubleBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsDoubleBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsDoubleBuffer() 79 byteOffset = off; in ByteBufferAsDoubleBuffer() 177 public DoubleBuffer get(double[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public DoubleBuffer get(int index, double[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public DoubleBuffer put(double[] src, int off, int length) { in put() argument [all …]
|
D | ByteBufferAsShortBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsShortBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsShortBuffer() 79 byteOffset = off; in ByteBufferAsShortBuffer() 177 public ShortBuffer get(short[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public ShortBuffer get(int index, short[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public ShortBuffer put(short[] src, int off, int length) { in put() argument [all …]
|
D | ByteBufferAsFloatBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsFloatBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsFloatBuffer() 79 byteOffset = off; in ByteBufferAsFloatBuffer() 177 public FloatBuffer get(float[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public FloatBuffer get(int index, float[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public FloatBuffer put(float[] src, int off, int length) { in put() argument [all …]
|
D | ByteBufferAsCharBuffer.java | 56 int off, ByteOrder order) in ByteBufferAsCharBuffer() argument 75 this.address = bb.address + off; in ByteBufferAsCharBuffer() 79 byteOffset = off; in ByteBufferAsCharBuffer() 177 public CharBuffer get(char[] dst, int off, int length) { in get() argument 178 Objects.checkFromIndexSize(off, length, dst.length); in get() 181 bb.getUnchecked(ix(position), dst, off, length); in get() local 187 public CharBuffer get(int index, char[] dst, int off, int length) { in get() argument 189 Objects.checkFromIndexSize(off, length, dst.length); in get() 190 bb.getUnchecked(ix(index), dst, off, length); in get() local 242 public CharBuffer put(char[] src, int off, int length) { in put() argument [all …]
|
D | DirectByteBuffer.java | 138 int off) { in DirectByteBuffer() argument 139 this(memoryRef, mark, pos, lim, cap, off, false); in DirectByteBuffer() 144 int off, boolean isReadOnly) { in DirectByteBuffer() argument 145 super(mark, pos, lim, cap, memoryRef.buffer, off); in DirectByteBuffer() 148 address = memoryRef.allocatedAddress + off; in DirectByteBuffer() 177 int off = pos + offset; in slice() local 178 assert (off >= 0); in slice() 179 return new DirectByteBuffer(memoryRef, -1, 0, rem, rem, off, isReadOnly); in slice() 468 int off = this.position(); in asCharBuffer() local 470 assert (off <= lim); in asCharBuffer() [all …]
|
/libcore/ojluni/src/test/java/nio/channels/Channels/ |
D | Basic2.java | 97 int len, off; in run() local 100 off = 0; in run() 104 off = rand.nextInt(64); in run() 105 n = in.read(buf, off, len); in run() 112 int value = buf[off + i]; in run() 144 int off, len; in run() local 148 off = 0; in run() 151 off = rand.nextInt(buf.length); in run() 152 int r = buf.length - off; in run() 157 buf[off + i] = value; in run() [all …]
|
/libcore/ojluni/src/main/java/java/net/ |
D | SocketInputStream.java | 97 byte b[], int off, int len, in socketRead0() argument 115 byte b[], int off, int len, in socketRead() argument 118 return socketRead0(fd, b, off, len, timeout); in socketRead() 142 public int read(byte b[], int off, int length) throws IOException { in read() argument 143 return read(b, off, length, impl.getTimeout()); in read() 146 int read(byte b[], int off, int length, int timeout) throws IOException { in read() argument 160 if (length <= 0 || off < 0 || length > b.length - off) { in read() 165 + " off == " + off + " buffer length == " + b.length); in read() 173 n = socketRead(fd, b, off, length, timeout); in read()
|
D | SocketOutputStream.java | 90 private native void socketWrite0(FileDescriptor fd, byte[] b, int off, in socketWrite0() argument 101 private void socketWrite(byte b[], int off, int len) throws IOException { in socketWrite() argument 104 if (len <= 0 || off < 0 || len > b.length - off) { in socketWrite() 109 + " off == " + off + " buffer length == " + b.length); in socketWrite() 116 socketWrite0(fd, b, off, len); in socketWrite() 155 public void write(byte b[], int off, int len) throws IOException { in write() argument 156 socketWrite(b, off, len); in write()
|
/libcore/ojluni/src/main/native/ |
D | io_util.c | 68 outOfBounds(JNIEnv *env, jint off, jint len, jbyteArray array) { in outOfBounds() argument 69 return ((off < 0) || in outOfBounds() 73 ((*env)->GetArrayLength(env, array) - off < len)); in outOfBounds() 78 jint off, jint len, jfieldID fid) in readBytes() argument 90 if (outOfBounds(env, off, len, bytes)) { in readBytes() 114 (*env)->SetByteArrayRegion(env, bytes, off, nread, (jbyte *)buf); in readBytes() 154 jint off, jint len, jboolean append, jfieldID fid) in writeBytes() argument 166 if (outOfBounds(env, off, len, bytes)) { in writeBytes() 183 (*env)->GetByteArrayRegion(env, bytes, off, len, (jbyte *)buf); in writeBytes() 186 off = 0; in writeBytes() [all …]
|
/libcore/ojluni/src/main/java/java/nio/channels/ |
D | Channels.java | 157 public synchronized void write(byte[] bs, int off, int len) in newOutputStream() argument 160 if ((off < 0) || (off > bs.length) || (len < 0) || in newOutputStream() 161 ((off + len) > bs.length) || ((off + len) < 0)) { in newOutputStream() 169 bb.limit(Math.min(off + len, bb.capacity())); in newOutputStream() 170 bb.position(off); in newOutputStream() 218 public synchronized int read(byte[] bs, int off, int len) in newInputStream() argument 221 if ((off < 0) || (off > bs.length) || (len < 0) || in newInputStream() 222 ((off + len) > bs.length) || ((off + len) < 0)) { in newInputStream() 231 bb.position(off); in newInputStream() 232 bb.limit(Math.min(off + len, bb.capacity())); in newInputStream() [all …]
|
/libcore/ojluni/src/main/java/sun/net/ |
D | TelnetInputStream.java | 136 public int read(byte bytes[], int off, int length) throws IOException { in read() argument 138 return super.read(bytes, off, length); in read() 141 int offStart = off; in read() 147 bytes[off++] = (byte)c; in read() 149 return (off > offStart) ? off - offStart : -1; in read()
|