You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by do...@apache.org on 2001/12/22 13:47:22 UTC
cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar TarBuffer.java TarConstants.java TarEntry.java TarInputStream.java TarOutputStream.java TarUtils.java
donaldp 01/12/22 04:47:21
Modified: proposal/myrmidon/src/main/org/apache/tools/tar
TarBuffer.java TarConstants.java TarEntry.java
TarInputStream.java TarOutputStream.java
TarUtils.java
Log:
restyled
Revision Changes Path
1.2 +24 -23 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarBuffer.java
Index: TarBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarBuffer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarBuffer.java 2001/12/15 12:06:33 1.1
+++ TarBuffer.java 2001/12/22 12:47:21 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.tar;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -137,7 +138,7 @@
{
for( int i = 0, sz = this.getRecordSize(); i < sz; ++i )
{
- if( record[i] != 0 )
+ if( record[ i ] != 0 )
{
return false;
}
@@ -165,7 +166,7 @@
this.flushBlock();
if( this.outStream != System.out
- && this.outStream != System.err )
+ && this.outStream != System.err )
{
this.outStream.close();
@@ -195,7 +196,7 @@
if( this.debug )
{
System.err.println( "ReadRecord: recIdx = " + this.currRecIdx
- + " blkIdx = " + this.currBlkIdx );
+ + " blkIdx = " + this.currBlkIdx );
}
if( this.inStream == null )
@@ -211,11 +212,11 @@
}
}
- byte[] result = new byte[this.recordSize];
+ byte[] result = new byte[ this.recordSize ];
System.arraycopy( this.blockBuffer,
- ( this.currRecIdx * this.recordSize ), result, 0,
- this.recordSize );
+ ( this.currRecIdx * this.recordSize ), result, 0,
+ this.recordSize );
this.currRecIdx++;
@@ -233,7 +234,7 @@
if( this.debug )
{
System.err.println( "SkipRecord: recIdx = " + this.currRecIdx
- + " blkIdx = " + this.currBlkIdx );
+ + " blkIdx = " + this.currBlkIdx );
}
if( this.inStream == null )
@@ -264,7 +265,7 @@
if( this.debug )
{
System.err.println( "WriteRecord: recIdx = " + this.currRecIdx
- + " blkIdx = " + this.currBlkIdx );
+ + " blkIdx = " + this.currBlkIdx );
}
if( this.outStream == null )
@@ -275,9 +276,9 @@
if( record.length != this.recordSize )
{
throw new IOException( "record to write has length '"
- + record.length
- + "' which is not the record size of '"
- + this.recordSize + "'" );
+ + record.length
+ + "' which is not the record size of '"
+ + this.recordSize + "'" );
}
if( this.currRecIdx >= this.recsPerBlock )
@@ -286,8 +287,8 @@
}
System.arraycopy( record, 0, this.blockBuffer,
- ( this.currRecIdx * this.recordSize ),
- this.recordSize );
+ ( this.currRecIdx * this.recordSize ),
+ this.recordSize );
this.currRecIdx++;
}
@@ -306,7 +307,7 @@
if( this.debug )
{
System.err.println( "WriteRecord: recIdx = " + this.currRecIdx
- + " blkIdx = " + this.currBlkIdx );
+ + " blkIdx = " + this.currBlkIdx );
}
if( this.outStream == null )
@@ -317,9 +318,9 @@
if( ( offset + this.recordSize ) > buf.length )
{
throw new IOException( "record has length '" + buf.length
- + "' with offset '" + offset
- + "' which is less than the record size of '"
- + this.recordSize + "'" );
+ + "' with offset '" + offset
+ + "' which is less than the record size of '"
+ + this.recordSize + "'" );
}
if( this.currRecIdx >= this.recsPerBlock )
@@ -328,8 +329,8 @@
}
System.arraycopy( buf, offset, this.blockBuffer,
- ( this.currRecIdx * this.recordSize ),
- this.recordSize );
+ ( this.currRecIdx * this.recordSize ),
+ this.recordSize );
this.currRecIdx++;
}
@@ -370,7 +371,7 @@
this.blockSize = blockSize;
this.recordSize = recordSize;
this.recsPerBlock = ( this.blockSize / this.recordSize );
- this.blockBuffer = new byte[this.blockSize];
+ this.blockBuffer = new byte[ this.blockSize ];
if( this.inStream != null )
{
@@ -409,7 +410,7 @@
while( bytesNeeded > 0 )
{
long numBytes = this.inStream.read( this.blockBuffer, offset,
- bytesNeeded );
+ bytesNeeded );
//
// NOTE
@@ -437,8 +438,8 @@
if( this.debug )
{
System.err.println( "ReadBlock: INCOMPLETE READ "
- + numBytes + " of " + this.blockSize
- + " bytes read." );
+ + numBytes + " of " + this.blockSize
+ + " bytes read." );
}
}
}
1.2 +9 -9 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarConstants.java
Index: TarConstants.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarConstants.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarConstants.java 2001/12/15 12:06:33 1.1
+++ TarConstants.java 2001/12/22 12:47:21 1.2
@@ -82,42 +82,42 @@
/**
* Normal file type.
*/
- byte LF_NORMAL = ( byte )'0';
+ byte LF_NORMAL = (byte)'0';
/**
* Link file type.
*/
- byte LF_LINK = ( byte )'1';
+ byte LF_LINK = (byte)'1';
/**
* Symbolic link file type.
*/
- byte LF_SYMLINK = ( byte )'2';
+ byte LF_SYMLINK = (byte)'2';
/**
* Character device file type.
*/
- byte LF_CHR = ( byte )'3';
+ byte LF_CHR = (byte)'3';
/**
* Block device file type.
*/
- byte LF_BLK = ( byte )'4';
+ byte LF_BLK = (byte)'4';
/**
* Directory file type.
*/
- byte LF_DIR = ( byte )'5';
+ byte LF_DIR = (byte)'5';
/**
* FIFO (pipe) file type.
*/
- byte LF_FIFO = ( byte )'6';
+ byte LF_FIFO = (byte)'6';
/**
* Contiguous file type.
*/
- byte LF_CONTIG = ( byte )'7';
+ byte LF_CONTIG = (byte)'7';
/**
* The magic tag representing a POSIX tar archive.
@@ -137,5 +137,5 @@
/**
* Identifies the *next* file on the tape as having a long name.
*/
- byte LF_GNUTYPE_LONGNAME = ( byte )'L';
+ byte LF_GNUTYPE_LONGNAME = (byte)'L';
}
1.2 +16 -17 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarEntry.java
Index: TarEntry.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarEntry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarEntry.java 2001/12/15 12:06:33 1.1
+++ TarEntry.java 2001/12/22 12:47:21 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.tar;
+
import java.io.File;
import java.util.Date;
@@ -190,8 +191,8 @@
char ch2 = name.charAt( 1 );
if( ch2 == ':'
- && ( ( ch1 >= 'a' && ch1 <= 'z' )
- || ( ch1 >= 'A' && ch1 <= 'Z' ) ) )
+ && ( ( ch1 >= 'a' && ch1 <= 'z' )
+ || ( ch1 >= 'A' && ch1 <= 'Z' ) ) )
{
name = name.substring( 2 );
}
@@ -406,15 +407,15 @@
{
if( this.file == null || !this.file.isDirectory() )
{
- return new TarEntry[0];
+ return new TarEntry[ 0 ];
}
String[] list = this.file.list();
- TarEntry[] result = new TarEntry[list.length];
+ TarEntry[] result = new TarEntry[ list.length ];
for( int i = 0; i < list.length; ++i )
{
- result[i] = new TarEntry( new File( this.file, list[i] ) );
+ result[ i ] = new TarEntry( new File( this.file, list[ i ] ) );
}
return result;
@@ -490,7 +491,6 @@
return this.size;
}
-
/**
* Get this entry's user id.
*
@@ -549,7 +549,6 @@
return false;
}
-
/**
* Indicate if this entry is a GNU long name block
*
@@ -585,19 +584,19 @@
this.name = TarUtils.parseName( header, offset, NAMELEN );
offset += NAMELEN;
- this.mode = ( int )TarUtils.parseOctal( header, offset, MODELEN );
+ this.mode = (int)TarUtils.parseOctal( header, offset, MODELEN );
offset += MODELEN;
- this.userId = ( int )TarUtils.parseOctal( header, offset, UIDLEN );
+ this.userId = (int)TarUtils.parseOctal( header, offset, UIDLEN );
offset += UIDLEN;
- this.groupId = ( int )TarUtils.parseOctal( header, offset, GIDLEN );
+ this.groupId = (int)TarUtils.parseOctal( header, offset, GIDLEN );
offset += GIDLEN;
this.size = TarUtils.parseOctal( header, offset, SIZELEN );
offset += SIZELEN;
this.modTime = TarUtils.parseOctal( header, offset, MODTIMELEN );
offset += MODTIMELEN;
- this.checkSum = ( int )TarUtils.parseOctal( header, offset, CHKSUMLEN );
+ this.checkSum = (int)TarUtils.parseOctal( header, offset, CHKSUMLEN );
offset += CHKSUMLEN;
- this.linkFlag = header[offset++];
+ this.linkFlag = header[ offset++ ];
this.linkName = TarUtils.parseName( header, offset, NAMELEN );
offset += NAMELEN;
this.magic = TarUtils.parseName( header, offset, MAGICLEN );
@@ -606,9 +605,9 @@
offset += UNAMELEN;
this.groupName = TarUtils.parseName( header, offset, GNAMELEN );
offset += GNAMELEN;
- this.devMajor = ( int )TarUtils.parseOctal( header, offset, DEVLEN );
+ this.devMajor = (int)TarUtils.parseOctal( header, offset, DEVLEN );
offset += DEVLEN;
- this.devMinor = ( int )TarUtils.parseOctal( header, offset, DEVLEN );
+ this.devMinor = (int)TarUtils.parseOctal( header, offset, DEVLEN );
}
/**
@@ -631,10 +630,10 @@
for( int c = 0; c < CHKSUMLEN; ++c )
{
- outbuf[offset++] = ( byte )' ';
+ outbuf[ offset++ ] = (byte)' ';
}
- outbuf[offset++] = this.linkFlag;
+ outbuf[ offset++ ] = this.linkFlag;
offset = TarUtils.getNameBytes( this.linkName, outbuf, offset, NAMELEN );
offset = TarUtils.getNameBytes( this.magic, outbuf, offset, MAGICLEN );
offset = TarUtils.getNameBytes( this.userName, outbuf, offset, UNAMELEN );
@@ -644,7 +643,7 @@
while( offset < outbuf.length )
{
- outbuf[offset++] = 0;
+ outbuf[ offset++ ] = 0;
}
long checkSum = TarUtils.computeCheckSum( outbuf );
1.2 +50 -45 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarInputStream.java
Index: TarInputStream.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarInputStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarInputStream.java 2001/12/15 12:06:33 1.1
+++ TarInputStream.java 2001/12/22 12:47:21 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.tar;
+
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -48,7 +49,7 @@
this.buffer = new TarBuffer( is, blockSize, recordSize );
this.readBuf = null;
- this.oneBuf = new byte[1];
+ this.oneBuf = new byte[ 1 ];
this.debug = false;
this.hasHitEOF = false;
}
@@ -90,10 +91,10 @@
if( this.debug )
{
System.err.println( "TarInputStream: SKIP currENTRY '"
- + this.currEntry.getName() + "' SZ "
- + this.entrySize + " OFF "
- + this.entryOffset + " skipping "
- + numToSkip + " bytes" );
+ + this.currEntry.getName() + "' SZ "
+ + this.entrySize + " OFF "
+ + this.entryOffset + " skipping "
+ + numToSkip + " bytes" );
}
if( numToSkip > 0 )
@@ -131,56 +132,56 @@
{
this.currEntry = new TarEntry( headerBuf );
- if( !( headerBuf[257] == 'u' && headerBuf[258] == 's'
- && headerBuf[259] == 't' && headerBuf[260] == 'a'
- && headerBuf[261] == 'r' ) )
+ if( !( headerBuf[ 257 ] == 'u' && headerBuf[ 258 ] == 's'
+ && headerBuf[ 259 ] == 't' && headerBuf[ 260 ] == 'a'
+ && headerBuf[ 261 ] == 'r' ) )
{
this.entrySize = 0;
this.entryOffset = 0;
this.currEntry = null;
throw new IOException( "bad header in block "
- + this.buffer.getCurrentBlockNum()
- + " record "
- + this.buffer.getCurrentRecordNum()
- + ", " +
- "header magic is not 'ustar', but '"
- + headerBuf[257]
- + headerBuf[258]
- + headerBuf[259]
- + headerBuf[260]
- + headerBuf[261]
- + "', or (dec) "
- + ( ( int )headerBuf[257] )
- + ", "
- + ( ( int )headerBuf[258] )
- + ", "
- + ( ( int )headerBuf[259] )
- + ", "
- + ( ( int )headerBuf[260] )
- + ", "
- + ( ( int )headerBuf[261] ) );
+ + this.buffer.getCurrentBlockNum()
+ + " record "
+ + this.buffer.getCurrentRecordNum()
+ + ", " +
+ "header magic is not 'ustar', but '"
+ + headerBuf[ 257 ]
+ + headerBuf[ 258 ]
+ + headerBuf[ 259 ]
+ + headerBuf[ 260 ]
+ + headerBuf[ 261 ]
+ + "', or (dec) "
+ + ( (int)headerBuf[ 257 ] )
+ + ", "
+ + ( (int)headerBuf[ 258 ] )
+ + ", "
+ + ( (int)headerBuf[ 259 ] )
+ + ", "
+ + ( (int)headerBuf[ 260 ] )
+ + ", "
+ + ( (int)headerBuf[ 261 ] ) );
}
if( this.debug )
{
System.err.println( "TarInputStream: SET CURRENTRY '"
- + this.currEntry.getName()
- + "' size = "
- + this.currEntry.getSize() );
+ + this.currEntry.getName()
+ + "' size = "
+ + this.currEntry.getSize() );
}
this.entryOffset = 0;
// REVIEW How do we resolve this discrepancy?!
- this.entrySize = ( int )this.currEntry.getSize();
+ this.entrySize = (int)this.currEntry.getSize();
}
if( this.currEntry != null && this.currEntry.isGNULongNameEntry() )
{
// read in the name
StringBuffer longName = new StringBuffer();
- byte[] buffer = new byte[256];
+ byte[] buffer = new byte[ 256 ];
int length = 0;
while( ( length = read( buffer ) ) >= 0 )
{
@@ -240,7 +241,7 @@
public void copyEntryContents( OutputStream out )
throws IOException
{
- byte[] buf = new byte[32 * 1024];
+ byte[] buf = new byte[ 32 * 1024 ];
while( true )
{
@@ -260,7 +261,9 @@
*
* @param markLimit The limit to mark.
*/
- public void mark( int markLimit ) { }
+ public void mark( int markLimit )
+ {
+ }
/**
* Since we do not support marking just yet, we return false.
@@ -290,7 +293,7 @@
}
else
{
- return ( int )this.oneBuf[0];
+ return (int)this.oneBuf[ 0 ];
}
}
@@ -337,7 +340,7 @@
if( this.readBuf != null )
{
int sz = ( numToRead > this.readBuf.length ) ? this.readBuf.length
- : numToRead;
+ : numToRead;
System.arraycopy( this.readBuf, 0, buf, offset, sz );
@@ -348,7 +351,7 @@
else
{
int newLen = this.readBuf.length - sz;
- byte[] newBuf = new byte[newLen];
+ byte[] newBuf = new byte[ newLen ];
System.arraycopy( this.readBuf, sz, newBuf, 0, newLen );
@@ -368,7 +371,7 @@
{
// Unexpected EOF!
throw new IOException( "unexpected EOF with " + numToRead
- + " bytes unread" );
+ + " bytes unread" );
}
int sz = numToRead;
@@ -378,7 +381,7 @@
{
System.arraycopy( rec, 0, buf, offset, sz );
- this.readBuf = new byte[recLen - sz];
+ this.readBuf = new byte[ recLen - sz ];
System.arraycopy( rec, sz, this.readBuf, 0, recLen - sz );
}
@@ -402,7 +405,9 @@
/**
* Since we do not support marking just yet, we do nothing.
*/
- public void reset() { }
+ public void reset()
+ {
+ }
/**
* Skip bytes in the input buffer. This skips bytes in the current entry's
@@ -420,13 +425,13 @@
// This is horribly inefficient, but it ensures that we
// properly skip over bytes via the TarBuffer...
//
- byte[] skipBuf = new byte[8 * 1024];
+ byte[] skipBuf = new byte[ 8 * 1024 ];
- for( int num = numToSkip; num > 0; )
+ for( int num = numToSkip; num > 0; )
{
int numRead = this.read( skipBuf, 0,
- ( num > skipBuf.length ? skipBuf.length
- : num ) );
+ ( num > skipBuf.length ? skipBuf.length
+ : num ) );
if( numRead == -1 )
{
1.2 +19 -19 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarOutputStream.java
Index: TarOutputStream.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarOutputStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarOutputStream.java 2001/12/15 12:06:33 1.1
+++ TarOutputStream.java 2001/12/22 12:47:21 1.2
@@ -6,6 +6,7 @@
* the LICENSE file.
*/
package org.apache.tools.tar;
+
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -50,9 +51,9 @@
this.buffer = new TarBuffer( os, blockSize, recordSize );
this.debug = false;
this.assemLen = 0;
- this.assemBuf = new byte[recordSize];
- this.recordBuf = new byte[recordSize];
- this.oneBuf = new byte[1];
+ this.assemBuf = new byte[ recordSize ];
+ this.recordBuf = new byte[ recordSize ];
+ this.oneBuf = new byte[ 1 ];
}
/**
@@ -65,7 +66,6 @@
this.buffer.setDebug( debug );
}
-
/**
* Sets the debugging flag.
*
@@ -120,7 +120,7 @@
{
for( int i = this.assemLen; i < this.assemBuf.length; ++i )
{
- this.assemBuf[i] = 0;
+ this.assemBuf[ i ] = 0;
}
this.buffer.writeRecord( this.assemBuf );
@@ -132,8 +132,8 @@
if( this.currBytes < this.currSize )
{
throw new IOException( "entry closed at '" + this.currBytes
- + "' before the '" + this.currSize
- + "' bytes specified in the header were written" );
+ + "' before the '" + this.currSize
+ + "' bytes specified in the header were written" );
}
}
@@ -171,7 +171,7 @@
// create a TarEntry for the LongLink, the contents
// of which are the entry's name
TarEntry longLinkEntry = new TarEntry( TarConstants.GNU_LONGLINK,
- TarConstants.LF_GNUTYPE_LONGNAME );
+ TarConstants.LF_GNUTYPE_LONGNAME );
longLinkEntry.setSize( entry.getName().length() + 1 );
putNextEntry( longLinkEntry );
@@ -182,8 +182,8 @@
else if( longFileMode != LONGFILE_TRUNCATE )
{
throw new RuntimeException( "file name '" + entry.getName()
- + "' is too long ( > "
- + TarConstants.NAMELEN + " bytes)" );
+ + "' is too long ( > "
+ + TarConstants.NAMELEN + " bytes)" );
}
}
@@ -198,7 +198,7 @@
}
else
{
- this.currSize = ( int )entry.getSize();
+ this.currSize = (int)entry.getSize();
}
}
@@ -212,7 +212,7 @@
public void write( int b )
throws IOException
{
- this.oneBuf[0] = ( byte )b;
+ this.oneBuf[ 0 ] = (byte)b;
this.write( this.oneBuf, 0, 1 );
}
@@ -249,8 +249,8 @@
if( ( this.currBytes + numToWrite ) > this.currSize )
{
throw new IOException( "request to write '" + numToWrite
- + "' bytes exceeds size in header of '"
- + this.currSize + "' bytes" );
+ + "' bytes exceeds size in header of '"
+ + this.currSize + "' bytes" );
//
// We have to deal with assembly!!!
// The programmer can be writing little 32 byte chunks for all
@@ -267,9 +267,9 @@
int aLen = this.recordBuf.length - this.assemLen;
System.arraycopy( this.assemBuf, 0, this.recordBuf, 0,
- this.assemLen );
+ this.assemLen );
System.arraycopy( wBuf, wOffset, this.recordBuf,
- this.assemLen, aLen );
+ this.assemLen, aLen );
this.buffer.writeRecord( this.recordBuf );
this.currBytes += this.recordBuf.length;
@@ -280,7 +280,7 @@
else
{
System.arraycopy( wBuf, wOffset, this.assemBuf, this.assemLen,
- numToWrite );
+ numToWrite );
wOffset += numToWrite;
this.assemLen += numToWrite;
@@ -298,7 +298,7 @@
if( numToWrite < this.recordBuf.length )
{
System.arraycopy( wBuf, wOffset, this.assemBuf, this.assemLen,
- numToWrite );
+ numToWrite );
this.assemLen += numToWrite;
@@ -326,7 +326,7 @@
{
for( int i = 0; i < this.recordBuf.length; ++i )
{
- this.recordBuf[i] = 0;
+ this.recordBuf[ i ] = 0;
}
this.buffer.writeRecord( this.recordBuf );
1.2 +18 -18 jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarUtils.java
Index: TarUtils.java
===================================================================
RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/tar/TarUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TarUtils.java 2001/12/15 12:06:33 1.1
+++ TarUtils.java 2001/12/22 12:47:21 1.2
@@ -30,8 +30,8 @@
{
getOctalBytes( value, buf, offset, length );
- buf[offset + length - 1] = ( byte )' ';
- buf[offset + length - 2] = 0;
+ buf[ offset + length - 1 ] = (byte)' ';
+ buf[ offset + length - 2 ] = 0;
return offset + length;
}
@@ -47,7 +47,7 @@
*/
public static int getLongOctalBytes( long value, byte[] buf, int offset, int length )
{
- byte[] temp = new byte[length + 1];
+ byte[] temp = new byte[ length + 1 ];
getOctalBytes( value, temp, 0, length + 1 );
System.arraycopy( temp, 0, buf, offset, length );
@@ -70,12 +70,12 @@
for( i = 0; i < length && i < name.length(); ++i )
{
- buf[offset + i] = ( byte )name.charAt( i );
+ buf[ offset + i ] = (byte)name.charAt( i );
}
for( ; i < length; ++i )
{
- buf[offset + i] = 0;
+ buf[ offset + i ] = 0;
}
return offset + length;
@@ -92,31 +92,31 @@
*/
public static int getOctalBytes( long value, byte[] buf, int offset, int length )
{
- byte[] result = new byte[length];
+ byte[] result = new byte[ length ];
int idx = length - 1;
- buf[offset + idx] = 0;
+ buf[ offset + idx ] = 0;
--idx;
- buf[offset + idx] = ( byte )' ';
+ buf[ offset + idx ] = (byte)' ';
--idx;
if( value == 0 )
{
- buf[offset + idx] = ( byte )'0';
+ buf[ offset + idx ] = (byte)'0';
--idx;
}
else
{
for( long val = value; idx >= 0 && val > 0; --idx )
{
- buf[offset + idx] = ( byte )( ( byte )'0' + ( byte )( val & 7 ) );
+ buf[ offset + idx ] = (byte)( (byte)'0' + (byte)( val & 7 ) );
val = val >> 3;
}
}
for( ; idx >= 0; --idx )
{
- buf[offset + idx] = ( byte )' ';
+ buf[ offset + idx ] = (byte)' ';
}
return offset + length;
@@ -134,7 +134,7 @@
for( int i = 0; i < buf.length; ++i )
{
- sum += 255 & buf[i];
+ sum += 255 & buf[ i ];
}
return sum;
@@ -155,12 +155,12 @@
for( int i = offset; i < end; ++i )
{
- if( header[i] == 0 )
+ if( header[ i ] == 0 )
{
break;
}
- result.append( ( char )header[i] );
+ result.append( (char)header[ i ] );
}
return result;
@@ -183,26 +183,26 @@
for( int i = offset; i < end; ++i )
{
- if( header[i] == 0 )
+ if( header[ i ] == 0 )
{
break;
}
- if( header[i] == ( byte )' ' || header[i] == '0' )
+ if( header[ i ] == (byte)' ' || header[ i ] == '0' )
{
if( stillPadding )
{
continue;
}
- if( header[i] == ( byte )' ' )
+ if( header[ i ] == (byte)' ' )
{
break;
}
}
stillPadding = false;
- result = ( result << 3 ) + ( header[i] - '0' );
+ result = ( result << 3 ) + ( header[ i ] - '0' );
}
return result;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>