aboutsummaryrefslogtreecommitdiff
path: root/java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java')
-rw-r--r--java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java b/java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java
index 0785cc91..ec0c3e1c 100644
--- a/java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java
+++ b/java/src/test/java/com/google/protobuf/CodedOutputStreamTest.java
@@ -330,7 +330,7 @@ public class CodedOutputStreamTest extends TestCase {
assertTrue(codedStream.getTotalBytesWritten() > BUFFER_SIZE);
assertEquals(value.length * 1024, codedStream.getTotalBytesWritten());
}
-
+
public void testWriteToByteBuffer() throws Exception {
final int bufferSize = 16 * 1024;
ByteBuffer buffer = ByteBuffer.allocate(bufferSize);
@@ -351,7 +351,7 @@ public class CodedOutputStreamTest extends TestCase {
codedStream.writeRawByte((byte) 3);
}
codedStream.flush();
-
+
// Check that data is correctly written to the ByteBuffer.
assertEquals(0, buffer.remaining());
buffer.flip();
@@ -365,7 +365,7 @@ public class CodedOutputStreamTest extends TestCase {
assertEquals((byte) 3, buffer.get());
}
}
-
+
public void testWriteByteBuffer() throws Exception {
byte[] value = "abcde".getBytes("UTF-8");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -377,10 +377,10 @@ public class CodedOutputStreamTest extends TestCase {
// The above call shouldn't affect the ByteBuffer's state.
assertEquals(0, byteBuffer.position());
assertEquals(1, byteBuffer.limit());
-
+
// The correct way to write part of an array using ByteBuffer.
codedStream.writeRawBytes(ByteBuffer.wrap(value, 2, 1).slice());
-
+
codedStream.flush();
byte[] result = outputStream.toByteArray();
assertEquals(6, result.length);