@Override public void getCharArr(long byteIndex, char[] target, int elemoff, int numElems) { for ( int i=0; i <numElems; i++ ) { target[i+elemoff] = buffer.getChar((int) (byteIndex+i*2)); } }
@Override public char getChar(long byteIndex) { return buffer.getChar((int) byteIndex); }
@Override public char get (int index) { if (index < 0 || index >= limit) { throw new IndexOutOfBoundsException(); } return byteBuffer.getChar(index << 1); }
@Override public char get (int index) { if (index < 0 || index >= limit) { throw new IndexOutOfBoundsException(); } return byteBuffer.getChar(index << 1); }
@Override public Object read(ByteBuffer buff, int tag) { return buff.getChar(); }
@Override public char getChar(long i) { return buffer.getChar((int)i); } @Override public ByteIndexer putChar(long i, char c) {
ResTable_lib_entry(ByteBuffer buf, int offset) { super(buf, offset); packageId = buf.getInt(offset); for (int i = 0; i < packageName.length; i++) { packageName[i] = buf.getChar(offset + 4 + i * SIZEOF_SHORT); } } };
@Override public char get () { if (position == limit) { throw new BufferUnderflowException(); } return byteBuffer.getChar(position++ << 1); }
@Override public char get () { if (position == limit) { throw new BufferUnderflowException(); } return byteBuffer.getChar(position++ << 1); }
/** * Read the next {@code char} from the underlying {@link ByteBuffer}. * * @return The next {@code char}. */ public char readChar() { if (null != buffer) { return buffer.getChar(); } throw new BufferUnderflowException(); }
private static CharArray readCharArray( ByteBuffer bb, int offset ) { final int len = bb.getInt( offset ); offset += Integer.BYTES; final char[] array = new char[len]; for ( int i = 0; i < len; i++ ) { array[i] = bb.getChar( offset ); offset += Character.BYTES; } return charArray( array ); }
private String get(final int index) { int startOffset = _byteBuffer.getInt(index * Integer.BYTES); int endOffset = _byteBuffer.capacity(); if (index > 0) { endOffset = _byteBuffer.getInt((index - 1) * Integer.BYTES); } char[] chars = new char[(endOffset - startOffset) / Character.BYTES]; for (int i = 0, j = startOffset; i < chars.length; i++, j = j + Character.BYTES) { chars[i] = _byteBuffer.getChar(j); } return new String(chars); }
private static CharValue readChar( ByteBuffer chunk, int offset ) { return charValue( chunk.getChar( offset ) ); }
private static String readRawString( ByteBuffer chunk, int offset ) { final int len = chunk.getInt( offset ); if ( len == 0 ) { return ""; } offset += Integer.BYTES; final char[] chars = new char[len]; for ( int i = 0; i < len; i++ ) { chars[i] = chunk.getChar( offset ); offset += Character.BYTES; } return UnsafeUtil.newSharedArrayString( chars ); }
public ResTable_package(ByteBuffer buf, int offset) { super(buf, offset); header = new ResChunk_header(buf, offset); id = buf.getInt(offset + ResChunk_header.SIZEOF); for (int i = 0; i < name.length; i++) { name[i] = buf.getChar(offset + ResChunk_header.SIZEOF + 4 + i * 2); } typeStrings = buf.getInt(offset + ResChunk_header.SIZEOF + 4 + 256); lastPublicType = buf.getInt(offset + ResChunk_header.SIZEOF + 4 + 256 + 4); keyStrings = buf.getInt(offset + ResChunk_header.SIZEOF + 4 + 256 + 8); lastPublicKey = buf.getInt(offset + ResChunk_header.SIZEOF + 4 + 256 + 12); typeIdOffset = buf.getInt(offset + ResChunk_header.SIZEOF + 4 + 256 + 16); } };
/** * {@inheritDoc} */ @Override public char readChar() throws IOException { ensure(2); return buf.getChar(); }
/** * {@inheritDoc} */ @Override public char readChar() throws IOException { ensure(2); return buf.getChar(); }
/** {@inheritDoc} */ @Override public char[] readCharArray(int cnt) { ensureHasData(2 * cnt); char[] res = new char[cnt]; for (int i = 0; i < cnt; i++) res[i] = buf.getChar(); return res; }
/** * {@inheritDoc} */ @Override public char readChar() throws IOException { ensure(2); return buffer().getChar(); }
@Override public char getChar(long i) { if (RAW != null) { return RAW.getChar(array, checkIndex(i, array.length - 1)); } else { return getBuffer().getChar((int)i); } } @Override public ByteIndexer putChar(long i, char c) {