no need to check and throw eof in readBoolean, already done in readByte
This commit is contained in:
parent
a71f2eed99
commit
72eb1508c6
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package org.elasticsearch.common.io.stream;
|
package org.elasticsearch.common.io.stream;
|
||||||
|
|
||||||
import java.io.EOFException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.UTFDataFormatException;
|
import java.io.UTFDataFormatException;
|
||||||
|
@ -224,10 +223,7 @@ public abstract class StreamInput extends InputStream {
|
||||||
* Reads a boolean.
|
* Reads a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean readBoolean() throws IOException {
|
public final boolean readBoolean() throws IOException {
|
||||||
byte ch = readByte();
|
return readByte() != 0;
|
||||||
if (ch < 0)
|
|
||||||
throw new EOFException();
|
|
||||||
return (ch != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue