Index: components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java |
diff --git a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java |
index 6f83f0022c053c5193e85b3fdcaf92264a55da81..3da329169cb9b5c51bc507be86281476202b88f1 100644 |
--- a/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java |
+++ b/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java |
@@ -73,6 +73,7 @@ final class CronetFixedModeOutputStream extends CronetOutputStream { |
@Override |
public void write(int oneByte) throws IOException { |
+ checkNotClosed(); |
checkNotExceedContentLength(1); |
ensureBufferHasRemaining(); |
mBuffer.put((byte) oneByte); |
@@ -82,6 +83,7 @@ final class CronetFixedModeOutputStream extends CronetOutputStream { |
@Override |
public void write(byte[] buffer, int offset, int count) throws IOException { |
+ checkNotClosed(); |
if (buffer.length - offset < count || offset < 0 || count < 0) { |
throw new IndexOutOfBoundsException(); |
} |
@@ -126,6 +128,7 @@ final class CronetFixedModeOutputStream extends CronetOutputStream { |
* write more data. |
*/ |
private void uploadBufferInternal() throws IOException { |
+ checkNotClosed(); |
mBuffer.flip(); |
mMessageLoop.loop(); |
} |
@@ -142,8 +145,6 @@ final class CronetFixedModeOutputStream extends CronetOutputStream { |
} |
} |
- // TODO(xunjieli): implement close(). |
- |
// Below are CronetOutputStream implementations: |
@Override |