core/src/main/java/org/apache/commons/vfs2/provider/tar/TarEntry.java
/**
     * Write an entry's header information to a header buffer.
     *
     * @param buffer The tar entry header buffer to fill in.
     */
Write an entry's header information to a header buffer.
@param buffer The tar entry header buffer to fill in.
Write an entry ' s header information to a header buffer . @param buffer The tar entry header buffer to fill in .
public void writeEntryHeader(final byte[] buffer)
    {
        int offset = 0;
        offset = TarUtils.getNameBytes(name, buffer, offset, NAMELEN);
        offset = TarUtils.getOctalBytes(mode, buffer, offset, TarConstants.MODELEN);
        offset = TarUtils.getOctalBytes(userID, buffer, offset, TarConstants.UIDLEN);
        offset = TarUtils.getOctalBytes(groupID, buffer, offset, TarConstants.GIDLEN);
        offset = TarUtils.getLongOctalBytes(size, buffer, offset, TarConstants.SIZELEN);
        offset = TarUtils.getLongOctalBytes(modTime, buffer, offset, TarConstants.MODTIMELEN);
        final int checkSumOffset = offset;
        for (int i = 0; i < TarConstants.CHKSUMLEN; ++i)
        {
            buffer[offset++] = (byte) ' ';
        }
        buffer[offset++] = linkFlag;
        offset = TarUtils.getNameBytes(linkName, buffer, offset, NAMELEN);
        offset = TarUtils.getNameBytes(magic, buffer, offset, TarConstants.MAGICLEN);
        offset = TarUtils.getNameBytes(userName, buffer, offset, TarConstants.UNAMELEN);
        offset = TarUtils.getNameBytes(groupName, buffer, offset, TarConstants.GNAMELEN);
        offset = TarUtils.getOctalBytes(devMajor, buffer, offset, TarConstants.DEVLEN);
        offset = TarUtils.getOctalBytes(devMinor, buffer, offset, TarConstants.DEVLEN);
        while (offset < buffer.length)
        {
            buffer[offset++] = 0;
        }
        final long checkSum = TarUtils.computeCheckSum(buffer);
        TarUtils.getCheckSumOctalBytes(checkSum, buffer, checkSumOffset, TarConstants.CHKSUMLEN);
    }
public void writeEntryHeader ( final byte [ ] buffer ) { int offset = 0 ; offset = TarUtils . getNameBytes ( name , buffer , offset , NAMELEN ) ; offset = TarUtils . getOctalBytes ( mode , buffer , offset , TarConstants . MODELEN ) ; offset = TarUtils . getOctalBytes ( userID , buffer , offset , TarConstants . UIDLEN ) ; offset = TarUtils . getOctalBytes ( groupID , buffer , offset , TarConstants . GIDLEN ) ; offset = TarUtils . getLongOctalBytes ( size , buffer , offset , TarConstants . SIZELEN ) ; offset = TarUtils . getLongOctalBytes ( modTime , buffer , offset , TarConstants . MODTIMELEN ) ; final int checkSumOffset = offset ; for ( int i = 0 ; i < TarConstants . CHKSUMLEN ; ++ i ) { buffer [ offset ++ ] = ( byte ) ' ' ; } buffer [ offset ++ ] = linkFlag ; offset = TarUtils . getNameBytes ( linkName , buffer , offset , NAMELEN ) ; offset = TarUtils . getNameBytes ( magic , buffer , offset , TarConstants . MAGICLEN ) ; offset = TarUtils . getNameBytes ( userName , buffer , offset , TarConstants . UNAMELEN ) ; offset = TarUtils . getNameBytes ( groupName , buffer , offset , TarConstants . GNAMELEN ) ; offset = TarUtils . getOctalBytes ( devMajor , buffer , offset , TarConstants . DEVLEN ) ; offset = TarUtils . getOctalBytes ( devMinor , buffer , offset , TarConstants . DEVLEN ) ; while ( offset < buffer . length ) { buffer [ offset ++ ] = 0 ; } final long checkSum = TarUtils . computeCheckSum ( buffer ) ; TarUtils . getCheckSumOctalBytes ( checkSum , buffer , checkSumOffset , TarConstants . CHKSUMLEN ) ; }
Write an entry's header information to a header buffer.
Write an entry ' s header information to a header buffer .