Currently the javadoc seems to be in an inconsistent state with the current
code. For example:
1. * A <code>PushbackInputStream</code> adds
* functionality to another input stream, namely
* the ability to "push back" or "unread"
* one byte.
Starting from version 1.12 it supports unreading of more than a single byte,
providing 'unread(byte[])' and 'unread(byte[], int, int)' methods.
2. * there is no pushed-back byte (the field
* <code>pushBack</code> is initialized to
* <code>-1</code>).
Starting from 1.12, PushbackInputStream doesn't have 'int pushBack' field.
It's been changed to 'byte[] buf'.
3. * Pushes back a byte by copying it to the front of the pushback buffer.
* After this method returns, the next byte to be read will have the value
* <code>(byte)b</code>.
If I'm not mistaken the next value to be read will be 'b & 0xff'. It's a bit
fuzzy here, since we read an 'int' back rather than 'byte'.
4. * <p> The method <code>reset</code> for class
* <code>PushbackInputStream</code> does nothing except throw an
* <code>IOException</code>.
This is very wordy :)
Maybe there is something else. It's worth having a look.
code. For example:
1. * A <code>PushbackInputStream</code> adds
* functionality to another input stream, namely
* the ability to "push back" or "unread"
* one byte.
Starting from version 1.12 it supports unreading of more than a single byte,
providing 'unread(byte[])' and 'unread(byte[], int, int)' methods.
2. * there is no pushed-back byte (the field
* <code>pushBack</code> is initialized to
* <code>-1</code>).
Starting from 1.12, PushbackInputStream doesn't have 'int pushBack' field.
It's been changed to 'byte[] buf'.
3. * Pushes back a byte by copying it to the front of the pushback buffer.
* After this method returns, the next byte to be read will have the value
* <code>(byte)b</code>.
If I'm not mistaken the next value to be read will be 'b & 0xff'. It's a bit
fuzzy here, since we read an 'int' back rather than 'byte'.
4. * <p> The method <code>reset</code> for class
* <code>PushbackInputStream</code> does nothing except throw an
* <code>IOException</code>.
This is very wordy :)
Maybe there is something else. It's worth having a look.
- relates to
-
JDK-8064562 (doc) errors in java.io.PushbackInputStream API documentation
-
- Closed
-