@Test(expected = IndexOutOfBoundsException.class) public void testWrongLength() throws IOException { UnsafeStringReader reader = new UnsafeStringReader("abc"); char[] chars = new char[1]; reader.read(chars, 0, 2); }
@Override public int read() throws IOException { ensureOpen(); if (mPosition >= mLimit) return -1; return mString.charAt(mPosition++); }
UnsafeStringReader extends Reader { @Override public int read() throws IOException { ensureOpen(); if (mPosition >= mLimit) return -1; return mString.charAt(mPosition++); } }
UnsafeStringReader extends Reader { @Override public int read() throws IOException { ensureOpen(); if (mPosition >= mLimit) return -1; return mString.charAt(mPosition++); } UnsafeStringReader(String str); }
UnsafeStringReader extends Reader { @Override public int read() throws IOException { ensureOpen(); if (mPosition >= mLimit) return -1; return mString.charAt(mPosition++); } UnsafeStringReader(String str); @Override int read(); @Override int read(char[] cs, int off, int len); @Override long skip(long ns); @Override boolean ready(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close(); }
UnsafeStringReader extends Reader { @Override public int read() throws IOException { ensureOpen(); if (mPosition >= mLimit) return -1; return mString.charAt(mPosition++); } UnsafeStringReader(String str); @Override int read(); @Override int read(char[] cs, int off, int len); @Override long skip(long ns); @Override boolean ready(); @Override boolean markSupported(); @Override void mark(int readAheadLimit); @Override void reset(); @Override void close();  }