You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/05/16 15:30:37 UTC
svn commit: r1483351 -
/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
Author: ggregory
Date: Thu May 16 13:30:37 2013
New Revision: 1483351
URL: http://svn.apache.org/r1483351
Log:
Formatting.
Modified:
commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java?rev=1483351&r1=1483350&r2=1483351&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java Thu May 16 13:30:37 2013
@@ -113,27 +113,25 @@ public class ReversedLinesFileReader imp
final Charset charset = Charsets.toCharset(encoding);
final CharsetEncoder charsetEncoder = charset.newEncoder();
final float maxBytesPerChar = charsetEncoder.maxBytesPerChar();
- if(maxBytesPerChar==1f) {
+ if (maxBytesPerChar == 1f) {
// all one byte encodings are no problem
byteDecrement = 1;
- } else if(charset == Charset.forName("UTF-8")) {
+ } else if (charset == Charset.forName("UTF-8")) {
// UTF-8 works fine out of the box, for multibyte sequences a second UTF-8 byte can never be a newline byte
// http://en.wikipedia.org/wiki/UTF-8
byteDecrement = 1;
- } else if(charset == Charset.forName("Shift_JIS")) {
+ } else if (charset == Charset.forName("Shift_JIS")) {
// Same as for UTF-8
// http://www.herongyang.com/Unicode/JIS-Shift-JIS-Encoding.html
byteDecrement = 1;
- } else if(charset == Charset.forName("UTF-16BE") || charset == Charset.forName("UTF-16LE")) {
+ } else if (charset == Charset.forName("UTF-16BE") || charset == Charset.forName("UTF-16LE")) {
// UTF-16 new line sequences are not allowed as second tuple of four byte sequences,
// however byte order has to be specified
byteDecrement = 2;
- } else if(charset == Charset.forName("UTF-16")) {
- throw new UnsupportedEncodingException(
- "For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)");
+ } else if (charset == Charset.forName("UTF-16")) {
+ throw new UnsupportedEncodingException("For UTF-16, you need to specify the byte order (use UTF-16BE or UTF-16LE)");
} else {
- throw new UnsupportedEncodingException(
- "Encoding "+encoding+" is not supported yet (feel free to submit a patch)");
+ throw new UnsupportedEncodingException("Encoding " + encoding + " is not supported yet (feel free to submit a patch)");
}
// NOTE: The new line sequences are matched in the order given, so it is important that \r\n is BEFORE \n
newLineSequences = new byte[][] { "\r\n".getBytes(encoding), "\n".getBytes(encoding), "\r".getBytes(encoding) };