You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2015/06/07 19:32:33 UTC
svn commit: r1684050 -
/axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java
Author: veithen
Date: Sun Jun 7 17:32:33 2015
New Revision: 1684050
URL: http://svn.apache.org/r1684050
Log:
Fix whitespace.
Modified:
axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java
Modified: axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java?rev=1684050&r1=1684049&r2=1684050&view=diff
==============================================================================
--- axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java (original)
+++ axis/axis1/java/trunk/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java Sun Jun 7 17:32:33 2015
@@ -319,51 +319,51 @@ public class DimeBodyPart {
void send(java.io.OutputStream os, byte position, DynamicContentDataHandler dh,
final long maxchunk)
throws java.io.IOException {
-
- BufferedInputStream in = new BufferedInputStream(dh.getInputStream());
-
- final int myChunkSize = dh.getChunkSize();
-
- byte[] buffer1 = new byte[myChunkSize];
- byte[] buffer2 = new byte[myChunkSize];
-
- int bytesRead1 = 0 , bytesRead2 = 0;
-
- bytesRead1 = in.read(buffer1);
-
- if(bytesRead1 < 0) {
- sendHeader(os, position, 0, ONLY_CHUNK);
- os.write(pad, 0, dimePadding(0));
- return;
- }
- byte chunkbyte = CHUNK;
- do {
- bytesRead2 = in.read(buffer2);
-
- if(bytesRead2 < 0) {
- //last record...do not set the chunk bit.
- //buffer1 contains the last chunked record!!
-
- //Need to distinguish if this is the first
- //chunk to ensure the TYPE and ID are sent
- if ( chunkbyte == CHUNK ){
- chunkbyte = ONLY_CHUNK;
- } else {
- chunkbyte = LAST_CHUNK;
- }
- sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte);
- break;
- }
-
- sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte);
- //set chunk byte to next chunk flag to avoid
- //sending TYPE and ID on subsequent chunks
- chunkbyte = CHUNK_NEXT;
- //now that we have written out buffer1, copy buffer2 into to buffer1
- System.arraycopy(buffer2,0,buffer1,0,myChunkSize);
- bytesRead1 = bytesRead2;
-
- }while(bytesRead2 > 0);
+
+ BufferedInputStream in = new BufferedInputStream(dh.getInputStream());
+
+ final int myChunkSize = dh.getChunkSize();
+
+ byte[] buffer1 = new byte[myChunkSize];
+ byte[] buffer2 = new byte[myChunkSize];
+
+ int bytesRead1 = 0 , bytesRead2 = 0;
+
+ bytesRead1 = in.read(buffer1);
+
+ if(bytesRead1 < 0) {
+ sendHeader(os, position, 0, ONLY_CHUNK);
+ os.write(pad, 0, dimePadding(0));
+ return;
+ }
+ byte chunkbyte = CHUNK;
+ do {
+ bytesRead2 = in.read(buffer2);
+
+ if(bytesRead2 < 0) {
+ //last record...do not set the chunk bit.
+ //buffer1 contains the last chunked record!!
+
+ //Need to distinguish if this is the first
+ //chunk to ensure the TYPE and ID are sent
+ if ( chunkbyte == CHUNK ){
+ chunkbyte = ONLY_CHUNK;
+ } else {
+ chunkbyte = LAST_CHUNK;
+ }
+ sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte);
+ break;
+ }
+
+ sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte);
+ //set chunk byte to next chunk flag to avoid
+ //sending TYPE and ID on subsequent chunks
+ chunkbyte = CHUNK_NEXT;
+ //now that we have written out buffer1, copy buffer2 into to buffer1
+ System.arraycopy(buffer2,0,buffer1,0,myChunkSize);
+ bytesRead1 = bytesRead2;
+
+ }while(bytesRead2 > 0);
}
protected void sendChunk(java.io.OutputStream os,
@@ -415,7 +415,7 @@ public class DimeBodyPart {
if ( MB || isFirstChunk ){ //If this is a follow on chunk dont send id again.
fixedHeader[1] = (byte) ((dtnf.toByte() << 4) & 0xf0);
} else {
- fixedHeader[1] = (byte) 0x00;
+ fixedHeader[1] = (byte) 0x00;
}
//OPT_T
@@ -430,7 +430,7 @@ public class DimeBodyPart {
fixedHeader[4] = (byte) ((id.length >>> 8) & 0xff);
fixedHeader[5] = (byte) ((id.length) & 0xff);
} else {
- fixedHeader[4] = (byte) 0;
+ fixedHeader[4] = (byte) 0;
fixedHeader[5] = (byte) 0;
}
@@ -439,7 +439,7 @@ public class DimeBodyPart {
fixedHeader[6] = (byte) ((type.length >>> 8) & 0xff);
fixedHeader[7] = (byte) ((type.length) & 0xff);
} else {
- fixedHeader[6] = (byte) 0;
+ fixedHeader[6] = (byte) 0;
fixedHeader[7] = (byte) 0;
}