Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 111 for alignment (0.05 sec)

  1. src/test/java/jcifs/smb1/smb1/ServerMessageBlockTest.java

            String testString = "Aligned Unicode";
            byte[] buffer = new byte[testString.length() * 2 + 2 + 1]; // +1 for alignment
            int len = smb.writeString(testString, buffer, 1);
            // When dstIndex=1 and headerStart=1, (1-1)%2=0, no alignment padding needed
            // Length is string bytes (15*2) + 2 null terminators = 32
            assertEquals(testString.length() * 2 + 2, len);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  2. src/main/java/jcifs/internal/smb2/persistent/DurableHandleRequest.java

        }
    
        @Override
        public byte[] getName() {
            return CONTEXT_NAME_BYTES;
        }
    
        @Override
        public int size() {
            // Context header (16) + name length (4) + padding to 8-byte alignment + data (16)
            return 16 + 4 + 4 + STRUCTURE_SIZE;
        }
    
        @Override
        public int encode(byte[] dst, int dstIndex) {
            int start = dstIndex;
    
            // Write context header
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  3. src/main/java/jcifs/internal/smb2/persistent/DurableHandleReconnect.java

         */
        public byte[] getFileId() {
            return Arrays.copyOf(fileId, 16);
        }
    
        @Override
        public int size() {
            // Context header (16) + name length (4) + padding to 8-byte alignment + data (16)
            return 16 + 4 + 4 + STRUCTURE_SIZE;
        }
    
        @Override
        public int encode(byte[] dst, int dstIndex) {
            int start = dstIndex;
    
            // Write context header
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 3K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb1/smb1/Trans2SetFileInformation.java

            writeInt2(0x80 | attributes, dst, dstIndex);
            dstIndex += 2;
            /* 6 zeros observed with NT */
            writeInt8(0L, dst, dstIndex);
            dstIndex += 6;
    
            /* Also observed 4 byte alignment but we stick
             * with the default for jCIFS which is 2 */
    
            return dstIndex - start;
        }
    
        @Override
        int readSetupWireFormat(final byte[] buffer, final int bufferIndex, final int len) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  5. src/main/java/jcifs/internal/smb2/ServerMessageBlock2Request.java

            final int exp = size();
            final int actual = getLength();
            if (exp != actual) {
                // Log the size mismatch for debugging but don't throw exception
                // This can occur due to padding alignment differences between size8() and pad8()
                if (log.isDebugEnabled()) {
                    log.debug("Size calculation mismatch: expected {} but got {} (difference: {})", exp, actual, actual - exp);
                }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Mon Aug 25 14:34:10 UTC 2025
    - 7.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/internal/smb2/lock/Smb2LockRequestTest.java

                int expectedSize = Smb2Constants.SMB2_HEADER_LENGTH + 24 + 24; // header + structure + 1 lock
                expectedSize = ((expectedSize + 7) / 8) * 8; // 8-byte alignment
                assertEquals(expectedSize, req.size());
            }
    
            @Test
            @DisplayName("Should calculate size correctly with multiple locks")
            void testSizeWithMultipleLocks() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 25.3K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb1/smb1/ServerMessageBlock.java

        int writeString(final String str, final byte[] dst, int dstIndex, final boolean useUnicode) {
            final int start = dstIndex;
    
            try {
                if (useUnicode) {
                    // Unicode requires word alignment
                    if ((dstIndex - headerStart) % 2 != 0) {
                        dst[dstIndex++] = (byte) '\0';
                    }
                    System.arraycopy(str.getBytes(UNI_ENCODING), 0, dst, dstIndex, str.length() * 2);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  8. src/test/java/jcifs/internal/smb2/tree/Smb2TreeDisconnectRequestTest.java

            request.writeBytesWireFormat(buffer, 10);
    
            // Then - verify reserved field is zero
            assertEquals(0, SMBUtil.readInt2(buffer, 12));
        }
    
        @Test
        @DisplayName("Should verify size8 alignment")
        void testSize8Alignment() throws Exception {
            // Given
            Configuration mockConfig = mock(Configuration.class);
            Smb2TreeDisconnectRequest request = new Smb2TreeDisconnectRequest(mockConfig);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  9. src/main/java/jcifs/internal/smb2/ServerMessageBlock2.java

        /**
         * Rounds up the size to 8-byte alignment.
         *
         * @param size the size to align
         * @return the aligned size
         */
        protected static final int size8(final int size) {
            return size8(size, 0);
        }
    
        /**
         * Rounds up the size to the specified alignment.
         *
         * @param size the size to align
         * @param align the alignment boundary
         * @return the aligned size
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 24K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb1/com/SmbComRenameTest.java

            assertEquals((byte) 0x04, dst[0]); // First buffer format byte
    
            // Find the second buffer format byte by searching for it
            // In Unicode mode, the old filename is written as Unicode, then 0x04, then an alignment byte
            int secondBufferFormatIndex = -1;
            for (int i = 1; i < result - 1; i++) {
                if (dst[i] == (byte) 0x04) {
                    secondBufferFormatIndex = i;
                    break;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.5K bytes
    - Viewed (0)
Back to top