1 package org.robolectric.res.android; 2 3 import java.nio.ByteBuffer; 4 import org.robolectric.res.android.ResourceTypes.Idmap_header; 5 import org.robolectric.res.android.ResourceTypes.WithOffset; 6 7 public class StringPiece extends WithOffset { 8 StringPiece(ByteBuffer buf, int offset)9 StringPiece(ByteBuffer buf, int offset) { 10 super(buf, offset); 11 } 12 size()13 public int size() { 14 return myBuf().capacity() - myOffset(); 15 } 16 asIdmap_header()17 public Idmap_header asIdmap_header() { 18 return new Idmap_header(myBuf(), myOffset()); 19 } 20 } 21