Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheng Chang committed Oct 30, 2017
1 parent 3b5e3ab commit 0ac7ee7
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -63,7 +63,7 @@ public class FileInStream extends InputStream
Configuration.getBoolean(PropertyKey.USER_FILE_PASSIVE_CACHE_ENABLED);
private static final int UNINITIALIZED_BLOCK_INDEX = -1;
private static final int EOF_DATA = -1;
private static final int EOF_BLOCK_ID = -1;
private static final long EOF_BLOCK_ID = -1;

/** The instream options. */
private final InStreamOptions mInStreamOptions;
Expand Down Expand Up @@ -201,7 +201,7 @@ public int read(byte[] b, int off, int len) throws IOException {

private int readInternal() throws IOException {
if (remainingInternal() <= 0) {
return EOF_BLOCK_ID;
return EOF_DATA;
}
updateStreamsOnRead();
Preconditions.checkState(mCurrentBlockInStream != null, PreconditionMessage.ERR_UNEXPECTED_EOF);
Expand Down Expand Up @@ -442,7 +442,8 @@ private void closeOrCancelCacheStream() {
}

/**
* @return the current block id based on mBlockIndex, -1 if at the end of the file
* @return the current block id based on mBlockIndex, or {@link #EOF_BLOCK_ID} if at the end of
* the file
*/
private long getCurrentBlockId() {
if (remainingInternal() <= 0) {
Expand Down

0 comments on commit 0ac7ee7

Please sign in to comment.