1 // BEGIN-INTERNAL 2 package org.robolectric.shadows; 3 4 import android.content.res.AssetManager.AssetInputStream; 5 6 import org.robolectric.annotation.Implementation; 7 import org.robolectric.annotation.Implements; 8 9 import java.io.IOException; 10 import java.io.InputStream; 11 12 @SuppressWarnings("UnusedDeclaration") 13 @Implements(AssetInputStream.class) 14 public class ShadowAssetInputStream { 15 16 private InputStream delegate; 17 private boolean ninePatch; 18 19 InputStream getDelegate() { 20 return delegate; 21 } 22 23 void setDelegate(InputStream delegate) { 24 this.delegate = delegate; 25 } 26 27 boolean isNinePatch() { 28 return ninePatch; 29 } 30 31 void setNinePatch(boolean ninePatch) { 32 this.ninePatch = ninePatch; 33 } 34 35 @Implementation 36 protected int read() throws IOException { 37 return delegate.read(); 38 } 39 40 @Implementation 41 protected int read(byte[] b) throws IOException { 42 return delegate.read(b); 43 } 44 45 @Implementation 46 protected int read(byte[] b, int off, int len) throws IOException { 47 return delegate.read(b, off, len); 48 } 49 50 @Implementation 51 protected long skip(long n) throws IOException { 52 return delegate.skip(n); 53 } 54 55 @Implementation 56 protected int available() throws IOException { 57 return delegate.available(); 58 } 59 60 @Implementation 61 protected void close() throws IOException { 62 delegate.close(); 63 } 64 65 @Implementation 66 protected void mark(int readlimit) { 67 delegate.mark(readlimit); 68 } 69 70 @Implementation 71 protected void reset() throws IOException { 72 delegate.reset(); 73 } 74 75 @Implementation 76 protected boolean markSupported() { 77 return delegate.markSupported(); 78 } 79 } 80 // END-INTERNAL 81