@@ -113,27 +113,25 @@ public ReversedLinesFileReader(final File file, final int blockSize, final Chars
113113 final Charset charset = Charsets .toCharset (encoding );
114114 final CharsetEncoder charsetEncoder = charset .newEncoder ();
115115 final float maxBytesPerChar = charsetEncoder .maxBytesPerChar ();
116- if (maxBytesPerChar == 1f ) {
116+ if (maxBytesPerChar == 1f ) {
117117 // all one byte encodings are no problem
118118 byteDecrement = 1 ;
119- } else if (charset == Charset .forName ("UTF-8" )) {
119+ } else if (charset == Charset .forName ("UTF-8" )) {
120120 // UTF-8 works fine out of the box, for multibyte sequences a second UTF-8 byte can never be a newline byte
121121 // http://en.wikipedia.org/wiki/UTF-8
122122 byteDecrement = 1 ;
123- } else if (charset == Charset .forName ("Shift_JIS" )) {
123+ } else if (charset == Charset .forName ("Shift_JIS" )) {
124124 // Same as for UTF-8
125125 // http://www.herongyang.com/Unicode/JIS-Shift-JIS-Encoding.html
126126 byteDecrement = 1 ;
127- } else if (charset == Charset .forName ("UTF-16BE" ) || charset == Charset .forName ("UTF-16LE" )) {
127+ } else if (charset == Charset .forName ("UTF-16BE" ) || charset == Charset .forName ("UTF-16LE" )) {
128128 // UTF-16 new line sequences are not allowed as second tuple of four byte sequences,
129129 // however byte order has to be specified
130130 byteDecrement = 2 ;
131- } else if (charset == Charset .forName ("UTF-16" )) {
132- throw new UnsupportedEncodingException (
133- "For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)" );
131+ } else if (charset == Charset .forName ("UTF-16" )) {
132+ throw new UnsupportedEncodingException ("For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)" );
134133 } else {
135- throw new UnsupportedEncodingException (
136- "Encoding " +encoding +" is not supported yet (feel free to submit a patch)" );
134+ throw new UnsupportedEncodingException ("Encoding " + encoding + " is not supported yet (feel free to submit a patch)" );
137135 }
138136 // NOTE: The new line sequences are matched in the order given, so it is important that \r\n is BEFORE \n
139137 newLineSequences = new byte [][] { "\r \n " .getBytes (encoding ), "\n " .getBytes (encoding ), "\r " .getBytes (encoding ) };
0 commit comments