From 72eb1508c629d525dc97e1351c195ab415bda8fc Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 9 Dec 2011 10:05:07 +0200 Subject: [PATCH] no need to check and throw eof in readBoolean, already done in readByte --- .../org/elasticsearch/common/io/stream/StreamInput.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java b/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java index 19fddae5392..1aacc1c787a 100644 --- a/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java +++ b/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java @@ -19,7 +19,6 @@ package org.elasticsearch.common.io.stream; -import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.UTFDataFormatException; @@ -224,10 +223,7 @@ public abstract class StreamInput extends InputStream { * Reads a boolean. */ public final boolean readBoolean() throws IOException { - byte ch = readByte(); - if (ch < 0) - throw new EOFException(); - return (ch != 0); + return readByte() != 0; }