Writes count bytes from the byte array buffer starting at offset index to this stream. @param buffer the buffer to be written. @param offset the initial position in buffer to retrieve bytes. @param len the number of bytes of {@code bu
(byte[] buffer, int offset, int len)
| 195 | * {@code buffer}. |
| 196 | */ |
| 197 | @Override |
| 198 | public synchronized void write(byte[] buffer, int offset, int len) { |
| 199 | // avoid int overflow |
| 200 | if (offset < 0 || offset > buffer.length || len < 0 |
| 201 | || len > buffer.length - offset) { |
| 202 | throw new IndexOutOfBoundsException(Messages.getString("luni.13")); //$NON-NLS-1$ |
| 203 | } |
| 204 | if (len == 0) { |
| 205 | return; |
| 206 | } |
| 207 | |
| 208 | /* Expand if necessary */ |
| 209 | expand(len); |
| 210 | System.arraycopy(buffer, offset, buf, this.count, len); |
| 211 | this.count += len; |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Writes the specified byte {@code oneByte} to the OutputStream. Only the |