public static void main(String[] args) throws Exception {
String s = "123456789";
byte b[] = s.getBytes();
BufferedInputStream bis = new BufferedInputStream(
new ByteArrayInputStream(b));
PushbackInputStream pis = new PushbackInputStream(bis);
int tmp = 1;
int i = 0;
while ((tmp = pis.read()) != -1) {
if (i == 0)
pis.mark(100);
if (tmp == '3')
pis.unread('c');
System.out.print((char) tmp);
i++;
}
pis.close();
}
打印结果未123c45678