Home
last modified time | relevance | path

Searched refs:off (Results 1 – 25 of 165) sorted by relevance

1234567

/libcore/ojluni/src/main/java/java/io/
DBits.java39 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 …]
DStringWriter.java87 public void write(char cbuf[], int off, int len) { in write() argument
88 if ((off < 0) || (off > cbuf.length) || (len < 0) || in write()
89 ((off + len) > cbuf.length) || ((off + len) < 0)) { in write()
94 buf.append(cbuf, off, len); in write()
111 public void write(String str, int off, int len) { in write() argument
112 buf.append(str.substring(off, off + len)); in write()
DBufferedWriter.java173 public void write(char cbuf[], int off, int len) throws IOException { in write() argument
176 if ((off < 0) || (off > cbuf.length) || (len < 0) || in write()
177 ((off + len) > cbuf.length) || ((off + len) < 0)) { in write()
188 out.write(cbuf, off, len); in write()
192 int b = off, t = off + len; in write()
219 public void write(String s, int off, int len) throws IOException { in write() argument
223 int b = off, t = off + len; in write()
DObjectOutputStream.java723 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()
1907 public void write(byte[] b, int off, int len) throws IOException { in write() argument
1908 write(b, off, len, false); in write()
1929 void write(byte[] b, int off, int len, boolean copy) in write() argument
1934 out.write(b, off, len); in write()
1947 out.write(b, off, MAX_BLOCK_SIZE); in write()
1948 off += MAX_BLOCK_SIZE; in write()
[all …]
DObjectInputStream.java914 public int read(byte[] buf, int off, int len) throws IOException { in read() argument
918 int endoff = off + len; in read()
919 if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { in read()
922 return bin.read(buf, off, len, false); in read()
1084 public void readFully(byte[] buf, int off, int len) throws IOException { in readFully() argument
1085 int endoff = off + len; in readFully()
1086 if (off < 0 || len < 0 || endoff > buf.length || endoff < 0) { in readFully()
1089 bin.readFully(buf, off, len, false); in readFully()
2223 int off = getFieldOffset(name, Boolean.TYPE); in get() local
2224 return (off >= 0) ? Bits.getBoolean(primVals, off) : val; in get()
[all …]
DOutputStream.java106 public void write(byte b[], int off, int len) throws IOException { in write() argument
109 } else if ((off < 0) || (off > b.length) || (len < 0) || in write()
110 ((off + len) > b.length) || ((off + len) < 0)) { in write()
116 write(b[off + i]); in write()
DCharArrayWriter.java95 public void write(char c[], int off, int len) { in write() argument
96 if ((off < 0) || (off > c.length) || (len < 0) || in write()
97 ((off + len) > c.length) || ((off + len) < 0)) { in write()
107 System.arraycopy(c, off, buf, count, len); in write()
118 public void write(String str, int off, int len) { in write() argument
124 str.getChars(off, off + len, buf, count); in write()
DStringBufferInputStream.java111 public synchronized int read(byte b[], int off, int len) { in read() argument
114 } else if ((off < 0) || (off > b.length) || (len < 0) || in read()
115 ((off + len) > b.length) || ((off + len) < 0)) { in read()
133 b[off++] = (byte)s.charAt(pos++); in read()
DLineNumberInputStream.java130 public int read(byte b[], int off, int len) throws IOException { in read() argument
133 } else if ((off < 0) || (off > b.length) || (len < 0) || in read()
134 ((off + len) > b.length) || ((off + len) < 0)) { in read()
144 b[off] = (byte)c; in read()
154 b[off + i] = (byte)c; in read()
DPipedOutputStream.java138 public void write(byte b[], int off, int len) throws IOException { in write() argument
143 } else if ((off < 0) || (off > b.length) || (len < 0) || in write()
144 ((off + len) > b.length) || ((off + len) < 0)) { in write()
149 sink.receive(b, off, len); in write()
DPipedReader.java208 synchronized void receive(char c[], int off, int len) throws IOException { in receive() argument
210 receive(c[off++]); in receive()
296 public synchronized int read(char cbuf[], int off, int len) throws IOException { in read() argument
306 if ((off < 0) || (off > cbuf.length) || (len < 0) || in read()
307 ((off + len) > cbuf.length) || ((off + len) < 0)) { in read()
318 cbuf[off] = (char)c; in read()
321 cbuf[off + rlen] = buffer[out++]; in read()
DPushbackReader.java106 public int read(char cbuf[], int off, int len) throws IOException { in read() argument
113 } else if ((off < 0) || (off > cbuf.length)) { in read()
122 System.arraycopy(buf, pos, cbuf, off, avail); in read()
124 off += avail; in read()
128 len = super.read(cbuf, off, len); in read()
174 public void unread(char cbuf[], int off, int len) throws IOException { in unread() argument
180 System.arraycopy(cbuf, off, buf, pos, len); in unread()
DPushbackInputStream.java165 public int read(byte[] b, int off, int len) throws IOException { in read() argument
169 } else if (off < 0 || len < 0 || len > b.length - off) { in read()
180 System.arraycopy(buf, pos, b, off, avail); in read()
182 off += avail; in read()
186 len = super.read(b, off, len); in read()
229 public void unread(byte[] b, int off, int len) throws IOException { in unread() argument
235 System.arraycopy(b, off, buf, pos, len); in unread()
/libcore/ojluni/src/main/java/java/util/zip/
DInflater.java88 private int off, len; field in Inflater
141 public void setInput(byte[] b, int off, int len) { in setInput() argument
145 if (off < 0 || len < 0 || off > b.length - len) { in setInput()
150 this.off = off; in setInput()
177 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument
181 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary()
186 setDictionary(zsRef.address(), b, off, len); in setDictionary() local
266 public int inflate(byte[] b, int off, int len) in inflate() argument
272 if (off < 0 || len < 0 || off > b.length - len) { in inflate()
278 int n = inflateBytes(zsRef.address(), b, off, len); in inflate()
[all …]
DDeflater.java87 private int off, len; field in Deflater
217 public void setInput(byte[] b, int off, int len) { in setInput() argument
221 if (off < 0 || len < 0 || off > b.length - len) { in setInput()
226 this.off = off; in setInput()
253 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument
257 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary()
262 setDictionary(zsRef.address(), b, off, len); in setDictionary() local
383 public int deflate(byte[] b, int off, int len) { in deflate() argument
384 return deflate(b, off, len, NO_FLUSH); in deflate()
450 public int deflate(byte[] b, int off, int len, int flush) { in deflate() argument
[all …]
DZipUtils.java129 public static final int get16(byte b[], int off) { in get16() argument
130 return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8); in get16()
137 public static final long get32(byte b[], int off) { in get32() argument
138 return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL; in get32()
145 public static final long get64(byte b[], int off) { in get64() argument
146 return get32(b, off) | (get32(b, off+4) << 32); in get64()
DZipOutputStream.java317 public synchronized void write(byte[] b, int off, int len) in write() argument
321 if (off < 0 || len < 0 || off > b.length - len) { in write()
333 super.write(b, off, len); in write()
341 out.write(b, off, len); in write()
346 crc.update(b, off, len); in write()
365 long off = written; in finish() local
368 writeEND(off, written - off); in finish()
593 private void writeEND(long off, long len) throws IOException { in writeEND() argument
596 long xoff = off; in writeEND()
624 writeLong(off); // offset of central directory in writeEND()
[all …]
DZipEntry.java495 int off = 0; in setExtra0() local
497 while (off + 4 < len) { in setExtra0()
498 int tag = get16(extra, off); in setExtra0()
499 int sz = get16(extra, off + 2); in setExtra0()
500 off += 4; in setExtra0()
501 if (off + sz > len) // invalid data in setExtra0()
513 size = get64(extra, off); in setExtra0()
514 csize = get64(extra, off + 8); in setExtra0()
521 int pos = off + 4; // reserved 4 bytes in setExtra0()
529 int flag = Byte.toUnsignedInt(extra[off]); in setExtra0()
[all …]
/libcore/ojluni/src/main/java/java/nio/channels/
DChannels.java159 public synchronized void write(byte[] bs, int off, int len) in newOutputStream() argument
162 if ((off < 0) || (off > bs.length) || (len < 0) || in newOutputStream()
163 ((off + len) > bs.length) || ((off + len) < 0)) { in newOutputStream()
171 bb.limit(Math.min(off + len, bb.capacity())); in newOutputStream()
172 bb.position(off); in newOutputStream()
219 public synchronized int read(byte[] bs, int off, int len) in newInputStream() argument
222 if ((off < 0) || (off > bs.length) || (len < 0) || in newInputStream()
223 ((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/java/net/
DSocketInputStream.java98 byte b[], int off, int len, in socketRead0() argument
116 byte b[], int off, int len, in socketRead() argument
119 return socketRead0(fd, b, off, len, timeout); in socketRead()
143 public int read(byte b[], int off, int length) throws IOException { in read() argument
144 return read(b, off, length, impl.getTimeout()); in read()
147 int read(byte b[], int off, int length, int timeout) throws IOException { in read() argument
161 if (length <= 0 || off < 0 || length > b.length - off) { in read()
166 + " off == " + off + " buffer length == " + b.length); in read()
176 n = socketRead(fd, b, off, length, timeout); in read()
194 n = socketRead(fd, b, off, length, timeout); in read()
DSocketOutputStream.java91 private native void socketWrite0(FileDescriptor fd, byte[] b, int off, in socketWrite0() argument
102 private void socketWrite(byte b[], int off, int len) throws IOException { in socketWrite() argument
105 if (len <= 0 || off < 0 || len > b.length - off) { in socketWrite()
110 + " off == " + off + " buffer length == " + b.length); in socketWrite()
117 socketWrite0(fd, b, off, len); in socketWrite()
160 public void write(byte b[], int off, int len) throws IOException { in write() argument
161 socketWrite(b, off, len); in write()
/libcore/ojluni/src/main/java/sun/net/
DTelnetInputStream.java136 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()
/libcore/ojluni/src/main/native/
Dio_util.c68 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/util/
DBase64.java391 private int encode0(byte[] src, int off, int end, byte[] dst) { in encode0() argument
393 int sp = off; in encode0()
394 int slen = (end - off) / 3 * 3; in encode0()
395 int sl = off + slen; in encode0()
788 public void write(byte[] b, int off, int len) throws IOException { in write() argument
794 if (off < 0 || len < 0 || len > b.length - off) in write()
800 b1 = b[off++] & 0xff; in write()
807 b2 = b[off++] & 0xff; in write()
820 int bits = (b[off++] & 0xff) << 16 | in write()
821 (b[off++] & 0xff) << 8 | in write()
[all …]
/libcore/ojluni/src/main/java/java/nio/
DDirectByteBuffer.java132 int off) { in DirectByteBuffer() argument
133 this(memoryRef, mark, pos, lim, cap, off, false); in DirectByteBuffer()
138 int off, boolean isReadOnly) { in DirectByteBuffer() argument
139 super(mark, pos, lim, cap, memoryRef.buffer, off); in DirectByteBuffer()
142 address = memoryRef.allocatedAddress + off; in DirectByteBuffer()
165 int off = pos + offset; in slice() local
166 assert (off >= 0); in slice()
167 return new DirectByteBuffer(memoryRef, -1, 0, rem, rem, off, isReadOnly); in slice()
437 int off = this.position(); in asCharBuffer() local
439 assert (off <= lim); in asCharBuffer()
[all …]

1234567