public CFMutableData insert(long location, ByteBuffer bytes) { return replace(new CFRange(location, 0), bytes); }
public CFMutableData insert(long location, byte[] bytes) { return replace(new CFRange(location, 0), bytes, 0, bytes.length); }
public CFMutableData insert(long location, byte[] bytes, int offset, int length) { return replace(new CFRange(location, 0), bytes, offset, length); }
public byte[] getBytes() { int length = (int) getLength(); byte[] bytes = new byte[length]; getBytes(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
public byte[] getBytes() { int length = (int) getCount(); byte[] bytes = new byte[length]; getBits(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
@Override public String toString() { int len = (int) length(); if (len == 0) { return EMPTY_STRING; } char[] chars = new char[len]; getCharacters(getHandle(), new CFRange(0, len), VM.getArrayValuesAddress(chars)); return VM.newStringNoCopy(chars, 0, len); }
public CFMutableData insert(long location, byte[] bytes, int offset, int length) { return replace(new CFRange(location, 0), bytes, offset, length); }
public CFMutableData insert(long location, ByteBuffer bytes) { return replace(new CFRange(location, 0), bytes); }
public CFMutableData insert(long location, byte[] bytes) { return replace(new CFRange(location, 0), bytes, 0, bytes.length); }
public CFMutableData insert(long location, ByteBuffer bytes) { return replace(new CFRange(location, 0), bytes); }
public CFMutableData insert(long location, byte[] bytes) { return replace(new CFRange(location, 0), bytes, 0, bytes.length); }
public CFMutableData insert(long location, byte[] bytes, int offset, int length) { return replace(new CFRange(location, 0), bytes, offset, length); }
public byte[] getBytes() { int length = (int) getLength(); byte[] bytes = new byte[length]; getBytes(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
public byte[] getBytes() { int length = (int) getCount(); byte[] bytes = new byte[length]; getBits(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
public byte[] getBytes() { int length = (int) getLength(); byte[] bytes = new byte[length]; getBytes(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
public byte[] getBytes() { int length = (int) getCount(); byte[] bytes = new byte[length]; getBits(new CFRange(0, length), VM.getArrayValuesAddress(bytes)); return bytes; } /*<methods>*/
@Override public String toString() { int len = (int) length(); if (len == 0) { return EMPTY_STRING; } char[] chars = new char[len]; getCharacters(getHandle(), new CFRange(0, len), VM.getArrayValuesAddress(chars)); return VM.newStringNoCopy(chars, 0, len); }
@Override public String toString() { int len = (int) length(); if (len == 0) { return EMPTY_STRING; } char[] chars = new char[len]; getCharacters(getHandle(), new CFRange(0, len), VM.getArrayValuesAddress(chars)); return VM.newStringNoCopy(chars, 0, len); }
private static CFArray wrapLines(NSAttributedString astring, float wrapWidth) { CTFramesetter fs = CTFramesetter.create(astring); try { // iOS lays things out from max-y up to zero (inverted coordinate system); so we need to // provide a large height for our rectangle to ensure that all lines "fit" CGPath path = CGPath.createWithRect( new CGRect(0, 0, wrapWidth, Float.MAX_VALUE/2), CGAffineTransform.Identity()); CTFrame frame = fs.createFrame(new CFRange(0, 0), path, null); return frame.getLines(); } finally { fs.dispose(); } }
private static List<CTLine> wrapLines(NSAttributedString astring, float wrapWidth) { CTFramesetter fs = CTFramesetter.create(astring); try { // iOS lays things out from max-y up to zero (inverted coordinate system); so we need to // provide a large height for our rectangle to ensure that all lines "fit" CGPath path = CGPath.createWithRect( new CGRect(0, 0, wrapWidth, Float.MAX_VALUE/2), CGAffineTransform.Identity()); CTFrame frame = fs.createFrame(new CFRange(0, 0), path, null); return frame.getLines(); } finally { fs.dispose(); } }