@Test(expected = IndexOutOfBoundsException.class) public void testWrongOffset() { UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes()); stream.read(new byte[1], -1, 1); }
@Override public int read() { return (mPosition < mLimit) ? (mData[mPosition++] & 0xff) : -1; }
UnsafeByteArrayInputStream extends InputStream { @Override public int read() { return (mPosition < mLimit) ? (mData[mPosition++] & 0xff) : -1; } }
UnsafeByteArrayInputStream extends InputStream { @Override public int read() { return (mPosition < mLimit) ? (mData[mPosition++] & 0xff) : -1; } UnsafeByteArrayInputStream(byte buf[]);  UnsafeByteArrayInputStream(byte buf[], int offset);  UnsafeByteArrayInputStream(byte buf[], int offset, int length); }
UnsafeByteArrayInputStream extends InputStream { @Override public int read() { return (mPosition < mLimit) ? (mData[mPosition++] & 0xff) : -1; } UnsafeByteArrayInputStream(byte buf[]);  UnsafeByteArrayInputStream(byte buf[], int offset);  UnsafeByteArrayInputStream(byte buf[], int offset, int length); @Override int read(); @Override int read(byte b[], int off, int len); @Override long skip(long len); @Override int available(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close(); int position(); void position(int newPosition); int size(); }
UnsafeByteArrayInputStream extends InputStream { @Override public int read() { return (mPosition < mLimit) ? (mData[mPosition++] & 0xff) : -1; } UnsafeByteArrayInputStream(byte buf[]);  UnsafeByteArrayInputStream(byte buf[], int offset);  UnsafeByteArrayInputStream(byte buf[], int offset, int length); @Override int read(); @Override int read(byte b[], int off, int len); @Override long skip(long len); @Override int available(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close(); int position(); void position(int newPosition); int size();  }