Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for alignment (0.04 sec)

  1. src/main/java/jcifs/pac/PacDataInputStream.java

    import java.math.BigInteger;
    import java.util.Date;
    
    import jcifs.SmbConstants;
    import jcifs.smb.SID;
    
    /**
     * Input stream for reading PAC data structures with proper alignment and byte ordering.
     * Handles little-endian byte order and data alignment requirements of PAC structures.
     */
    public class PacDataInputStream {
    
        private final DataInputStream dis;
        private final int size;
    
        /**
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/smb1/ServerMessageBlockTest.java

            }
    
            @Test
            @DisplayName("Test write string with odd Unicode alignment")
            void testWriteStringUnicodeAlignment() {
                testBlock.setUseUnicode(true);
                byte[] buffer = new byte[100];
                String testString = "Test";
    
                // Test odd Unicode alignment - headerStart affects alignment
                int bytesWritten = testBlock.writeString(testString, buffer, 2);
    
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 36.2K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb1/dcerpc/ndr/NdrBuffer.java

            return buf;
        }
    
        /**
         * Aligns the buffer index to the specified boundary with a fill value.
         *
         * @param boundary the alignment boundary
         * @param value the fill value for padding
         * @return the number of bytes added for alignment
         */
        public int align(final int boundary, final byte value) {
            final int n = align(boundary);
            int i = n;
            while (i > 0) {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  4. src/main/java/jcifs/dcerpc/ndr/NdrBuffer.java

            return this.buf;
        }
    
        /**
         * Aligns the buffer index to the specified boundary with a fill value.
         *
         * @param boundary the alignment boundary
         * @param value the fill value for padding
         * @return the number of bytes added for alignment
         */
        public int align(final int boundary, final byte value) {
            final int n = align(boundary);
            int i = n;
            while (i > 0) {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  5. src/test/java/jcifs/pac/PacDataInputStreamTest.java

            // Test alignment from position 1 to 4
            byte[] data = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 };
            PacDataInputStream pdis = createInputStream(data);
            pdis.readByte(); // position is 1
            pdis.align(4);
            assertEquals(1, pdis.available());
            assertEquals(0x05, pdis.readByte());
    
            // Test no alignment needed
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/internal/smb2/session/Smb2SessionSetupRequestTest.java

            // Then
            // The writeBytesWireFormat writes the structure and calculates padding
            // Base structure: 24 bytes, then pad8 alignment, then token: 5 bytes
            // Total bytes written includes padding for 8-byte alignment
            int expectedBytesWritten = 35;
            assertEquals(expectedBytesWritten, bytesWritten);
    
            // Verify structure
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 21.2K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb1/smb1/Trans2FindFirst2Response.java

        }
    
        String readString(final byte[] src, final int srcIndex, int len) {
            String str = null;
            try {
                if (useUnicode) {
                    // should Unicode alignment be corrected for here?
                    str = new String(src, srcIndex, len, UNI_ENCODING);
                } else {
    
                    /* On NT without Unicode the fileNameLength
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  8. 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: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  9. 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: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 3K bytes
    - Viewed (0)
  10. 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: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 3.3K bytes
    - Viewed (0)
Back to top