Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/org/adblockplus/ChunkedOutputStream.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Patch Set: Adressed first batch of review issues. Created April 16, 2014, 5:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/com/github/rjeschke/neetutils/Strings.java ('k') | src/org/adblockplus/android/ABPEngine.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/ChunkedOutputStream.java
diff --git a/src/org/adblockplus/ChunkedOutputStream.java b/src/org/adblockplus/ChunkedOutputStream.java
index f4f26d120ef5c1ca6ba9230fb3f63e868358daf6..f1bb7814e2d32e6d84ccb88b7002785a02d9f862 100644
--- a/src/org/adblockplus/ChunkedOutputStream.java
+++ b/src/org/adblockplus/ChunkedOutputStream.java
@@ -28,12 +28,12 @@ import java.io.OutputStream;
public class ChunkedOutputStream extends FilterOutputStream
{
private static final int MAX_CHUNK_SIZE = 2048;
+ private static final byte[] CRLF = { '\r', '\n' };
+ private static final byte[] FINAL_CHUNK = new byte[] { '0', '\r', '\n', '\r', '\n' };
- private static final byte[] CRLF = {'\r', '\n'};
- private static final byte[] FINAL_CHUNK = new byte[] {'0', '\r', '\n', '\r', '\n'};
private boolean wroteFinalChunk = false;
- public ChunkedOutputStream(OutputStream out)
+ public ChunkedOutputStream(final OutputStream out)
{
super(out);
}
@@ -47,13 +47,13 @@ public class ChunkedOutputStream extends FilterOutputStream
}
@Override
- public void write(byte[] buffer, int offset, int length) throws IOException
+ public void write(final byte[] buffer, final int offset, final int length) throws IOException
{
writeChunk(buffer, offset, length);
}
@Override
- public void write(byte[] buffer) throws IOException
+ public void write(final byte[] buffer) throws IOException
{
int offset = 0;
int remain = buffer.length;
@@ -69,7 +69,7 @@ public class ChunkedOutputStream extends FilterOutputStream
}
@Override
- public void write(int oneByte) throws IOException
+ public void write(final int oneByte) throws IOException
{
throw new UnsupportedOperationException("Not implemented");
}
@@ -81,7 +81,8 @@ public class ChunkedOutputStream extends FilterOutputStream
wroteFinalChunk = true;
}
- private void writeChunk(byte buffer[], int offset, int length) throws IOException
+ private void writeChunk(final byte buffer[], final int offset, final int length)
+ throws IOException
{
// Zero sized buffers are ok on slow connections but not in our case - zero
// chunk is used to indicate the end of transfer.
@@ -98,7 +99,7 @@ public class ChunkedOutputStream extends FilterOutputStream
}
}
- private void writeHex(int i) throws IOException
+ private void writeHex(final int i) throws IOException
{
out.write(Integer.toHexString(i).getBytes());
out.write(CRLF);
« no previous file with comments | « src/com/github/rjeschke/neetutils/Strings.java ('k') | src/org/adblockplus/android/ABPEngine.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld