Skip to content

Commit c46ebc5

Browse files
committed
Fix style checks
1 parent c6468e8 commit c46ebc5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main/java/com/maxmind/db/BufferHolder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ final class BufferHolder {
5151
if (null == stream) {
5252
throw new NullPointerException("Unable to use a NULL InputStream");
5353
}
54-
final int CHUNK_SIZE = 16 * 1024;
54+
final int chunk_size = 16 * 1024;
5555
List<byte[]> chunks = new ArrayList<>();
5656
long total = 0;
5757
int read;
58-
byte[] tmp = new byte[CHUNK_SIZE];
58+
byte[] tmp = new byte[chunk_size];
5959

6060
while (-1 != (read = stream.read(tmp))) {
6161
byte[] copy = new byte[read];

src/main/java/com/maxmind/db/MultiBuffer.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import java.io.IOException;
44
import java.nio.ByteBuffer;
5+
import java.nio.CharBuffer;
56
import java.nio.channels.FileChannel;
67
import java.nio.charset.CharacterCodingException;
78
import java.nio.charset.CharsetDecoder;
8-
import java.nio.CharBuffer;
99
import java.nio.charset.CoderResult;
1010
import java.util.ArrayList;
1111
import java.util.List;
@@ -201,10 +201,14 @@ public long readFrom(FileChannel channel) throws IOException {
201201
ByteBuffer buf = buffers.get(i);
202202
buf.position((int) (pos % CHUNK_SIZE));
203203
int read = channel.read(buf);
204-
if (read == -1) break;
204+
if (read == -1) {
205+
break;
206+
}
205207
totalRead += read;
206208
pos += read;
207-
if (pos >= limit) break;
209+
if (pos >= limit) {
210+
break;
211+
}
208212
}
209213
position = pos;
210214
return totalRead;

0 commit comments

Comments
 (0)