no need to check and throw eof in readBoolean, already done in readByte

This commit is contained in:
Shay Banon 2011-12-09 10:05:07 +02:00
parent a71f2eed99
commit 72eb1508c6
1 changed files with 1 additions and 5 deletions

View File

@ -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);
} }