Exemplo n.º 1
0
public void @this(global::org.xmlvm._nArrayAdapter<sbyte> n1, int n2, int n3){
//XMLVM_BEGIN_WRAPPER[java.lang.String: void <init>(byte[], int, int)]
    base.@this();
    if (n2 < 0 || n3 < 0 || n3 > (((global::org.xmlvm._nIArray) n1).Length - n2)) {
	    global::java.lang.StringIndexOutOfBoundsException ex = new global::java.lang.StringIndexOutOfBoundsException();
	    ex.@this();
	    throw new global::org.xmlvm._nExceptionAdapter(ex);
	}
    _foffset = 0;
    global::java.nio.CharBuffer cbuf = (global::java.nio.CharBuffer)((global::java.nio.charset.Charset)defaultCharset()).decode((global::java.nio.ByteBuffer)global::java.nio.ByteBuffer.wrap(n1, n2, n3));
    int l = cbuf.length();
    if (l <= 0) {
	    _fcount = 0;
	    _fvalue = new global::org.xmlvm._nArrayAdapter<char>(new char[0]);
	} else {
	    _fvalue = (global::org.xmlvm._nArrayAdapter<char>) cbuf.array();
	    _fcount = l;
	}
//XMLVM_END_WRAPPER[java.lang.String: void <init>(byte[], int, int)]
}
Exemplo n.º 2
0
public void @this(global::org.xmlvm._nArrayAdapter<sbyte> data, int high, int start, int length){
//XMLVM_BEGIN_WRAPPER[java.lang.String: void <init>(byte[], int, int, int)]
    if (length <= (((global::org.xmlvm._nIArray) data).Length - start) && start >= 0 && 0 <= length) {
			_foffset = 0;
			_fvalue = new global::org.xmlvm._nArrayAdapter<char>(new char[length]);
			_fcount = length;
            high <<= 8;
            for (int i = 0; i < _fcount; i++) {
                _fvalue[i] = (char) (high + (data[start++] & 0xff));
            }
        } else {
            global::java.lang.StringIndexOutOfBoundsException ex = new global::java.lang.StringIndexOutOfBoundsException();
		    ex.@this();
		    throw new global::org.xmlvm._nExceptionAdapter(ex);
        }
//XMLVM_END_WRAPPER[java.lang.String: void <init>(byte[], int, int, int)]
}
Exemplo n.º 3
0
public void @this(global::org.xmlvm._nArrayAdapter<char> data, int start, int length){
//XMLVM_BEGIN_WRAPPER[java.lang.String: void <init>(char[], int, int)]
	if (start >= 0 && 0 <= length && length <= data.Length - start) {
    	_foffset = 0;
        _fvalue = new global::org.xmlvm._nArrayAdapter<char>(new char[length]);
        _fcount = length;
        System.arraycopy(data, start, _fvalue, 0, _fcount);
		global::java.lang.System.arraycopy((global::java.lang.Object) data, start, (global::java.lang.Object) _fvalue, 0, _fcount);
    } else {
		global::java.lang.StringIndexOutOfBoundsException ex = new global::java.lang.StringIndexOutOfBoundsException();
	    ex.@this();
	    throw new global::org.xmlvm._nExceptionAdapter(ex);
    }
//XMLVM_END_WRAPPER[java.lang.String: void <init>(char[], int, int)]
}
Exemplo n.º 4
0
		public void @this(global::org.xmlvm._nArrayAdapter<sbyte> data, int start, int length, global::java.lang.String encoding){
//XMLVM_BEGIN_WRAPPER[java.lang.String: void <init>(byte[], int, int, java.lang.String)]
    if (encoding == null) {
		global::java.lang.NullPointerException ex = new global::java.lang.NullPointerException();
		ex.@this();
		throw new global::org.xmlvm._nExceptionAdapter(ex);
	}
        // start + length could overflow, start/length maybe MaxInt
        if (start >= 0 && 0 <= length && length <= data.Length - start) {
            _foffset = 0;

            int result;
        	global::java.nio.CharBuffer cb;
            try {
				cb = (global::java.nio.CharBuffer)((global::java.nio.charset.Charset)getCharset(encoding)).decode((global::java.nio.ByteBuffer)global::java.nio.ByteBuffer.wrap(data, start, length));
            } catch (global::System.Exception e) {
            	// do nothing. according to spec: 
            	// behavior is unspecified for invalid array
                cb = (global::java.nio.CharBuffer)global::java.nio.CharBuffer.wrap(new global::org.xmlvm._nArrayAdapter<char>("\u003f".ToCharArray())); //$NON-NLS-1$
            }
            if ((result = cb.length()) > 0) {
                _fvalue = (global::org.xmlvm._nArrayAdapter<char>)cb.array();
                _fcount = result;
            } else {
                _fcount = 0;
                _fvalue = new global::org.xmlvm._nArrayAdapter<char>(new char[0]);
            }
        } else {
			global::java.lang.StringIndexOutOfBoundsException ex = new global::java.lang.StringIndexOutOfBoundsException();
		    ex.@this();
		    throw new global::org.xmlvm._nExceptionAdapter(ex);
		}
//XMLVM_END_WRAPPER[java.lang.String: void <init>(byte[], int, int, java.lang.String)]
}