@Test public void testSetTooLargePosition() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Position out of bounds."); stream.setPosition(data.length + 1); }
public void setPosition(int pos) { Preconditions.checkArgument(pos >= 0 && pos <= count, "Position out of bounds."); this.position = pos; }
ByteArrayInputStreamWithPos extends InputStream { public void setPosition(int pos) { Preconditions.checkArgument(pos >= 0 && pos <= count, "Position out of bounds."); this.position = pos; } }
ByteArrayInputStreamWithPos extends InputStream { public void setPosition(int pos) { Preconditions.checkArgument(pos >= 0 && pos <= count, "Position out of bounds."); this.position = pos; } ByteArrayInputStreamWithPos();  ByteArrayInputStreamWithPos(byte[] buffer);  ByteArrayInputStreamWithPos(byte[] buffer, int offset, int length); }
ByteArrayInputStreamWithPos extends InputStream { public void setPosition(int pos) { Preconditions.checkArgument(pos >= 0 && pos <= count, "Position out of bounds."); this.position = pos; } ByteArrayInputStreamWithPos();  ByteArrayInputStreamWithPos(byte[] buffer);  ByteArrayInputStreamWithPos(byte[] buffer, int offset, int length); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long toSkip); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override int available(); @Override void close(); int getPosition(); void setPosition(int pos); void setBuffer(byte[] buffer, int offset, int length); }
ByteArrayInputStreamWithPos extends InputStream { public void setPosition(int pos) { Preconditions.checkArgument(pos >= 0 && pos <= count, "Position out of bounds."); this.position = pos; } ByteArrayInputStreamWithPos();  ByteArrayInputStreamWithPos(byte[] buffer);  ByteArrayInputStreamWithPos(byte[] buffer, int offset, int length); @Override int read(); @Override int read(byte[] b, int off, int len); @Override long skip(long toSkip); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override int available(); @Override void close(); int getPosition(); void setPosition(int pos); void setBuffer(byte[] buffer, int offset, int length);  }