Code clean-up.

(cherry picked from commit 10b8c11)
This commit is contained in:
Harald Kuhr 2017-01-18 18:04:12 +01:00
parent cb2cf0721c
commit 3f6a27b75e
2 changed files with 3 additions and 16 deletions

View File

@ -38,6 +38,8 @@ import java.nio.ByteOrder;
import java.nio.channels.Channels; import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel; import java.nio.channels.ReadableByteChannel;
import static com.twelvemonkeys.imageio.plugins.tiff.HorizontalDifferencingStream.isValidBPS;
/** /**
* A decoder for data converted using "horizontal differencing predictor". * A decoder for data converted using "horizontal differencing predictor".
* *
@ -67,21 +69,6 @@ final class HorizontalDeDifferencingStream extends InputStream {
buffer.flip(); buffer.flip();
} }
private boolean isValidBPS(final int bitsPerSample) {
switch (bitsPerSample) {
case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
case 64:
return true;
default:
return false;
}
}
@SuppressWarnings("StatementWithEmptyBody") @SuppressWarnings("StatementWithEmptyBody")
private boolean fetch() throws IOException { private boolean fetch() throws IOException {
buffer.clear(); buffer.clear();

View File

@ -66,7 +66,7 @@ final class HorizontalDifferencingStream extends OutputStream {
buffer = ByteBuffer.allocate((columns * samplesPerPixel * bitsPerSample + 7) / 8).order(byteOrder); buffer = ByteBuffer.allocate((columns * samplesPerPixel * bitsPerSample + 7) / 8).order(byteOrder);
} }
private boolean isValidBPS(final int bitsPerSample) { static boolean isValidBPS(final int bitsPerSample) {
switch (bitsPerSample) { switch (bitsPerSample) {
case 1: case 1:
case 2: case 2: