Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 56 for alignment (0.12 sec)

  1. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 36.2K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb1/dcerpc/ndr/NdrHyperTest.java

        public void testEncodeRoundTrip() throws NdrException {
            final long original = 0x1122334455667788L;
            NdrHyper hyper = new NdrHyper(original);
            // Create buffer with extra space for alignment
            NdrBuffer buf = new NdrBuffer(new byte[16], 0);
            hyper.encode(buf);
            // Reset buffer position for decoding
            buf.reset();
            NdrHyper decoded = new NdrHyper(0);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  3. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 9.2K 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  5. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/dcerpc/ndr/NdrShortTest.java

         * to the buffer and that alignment is respected.
         */
        @Test
        void encodeWritesCorrectBytesAndAlignment() throws NdrException {
            NdrShort ns = new NdrShort(0xABCD); // value & 0xFF => 0xCD
            buf.reset();
            int startIndex = buf.getIndex();
            ns.encode(buf);
    
            // Find where the actual data starts (after alignment)
            int alignmentBytes = 0;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  7. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb1/smb1/SmbComOpenAndXTest.java

            smbComOpenAndX.useUnicode = true;
            // For Unicode: 1 byte (initial null in writeBytesWireFormat)
            // + potential 1 byte alignment (in writeString) + fileName.length() * 2 + 2 bytes (terminating nulls)
            // Since headerStart is 0 and dstIndex starts at 1 (after initial null), (1-0)%2=1, so alignment byte added
            // Total: 1 + 1 + 12*2 + 2 = 28 bytes
            byte[] dst = new byte[30]; // Use extra buffer space to avoid index errors
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  9. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  10. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 21.2K bytes
    - Viewed (0)
Back to top