@Override public void write(byte[] b, int off, int len) { ensureCapacity(len); System.arraycopy(b, off, buf, count, len); count += len; }
/** * Writes a string as ASCII string. * * @param s string to write. */ public void writeAsAscii(String s) { int len = s.length(); ensureCapacity(len); int ptr = count; for( int i=0; i<len; i++ ) buf[ptr++] = (byte)s.charAt(i); count = ptr; }