Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for readUShort (0.06 sec)

  1. src/test/java/jcifs/ntlmssp/NtlmMessageTest.java

        }
    
        @Test
        void testReadUShort() {
            // Test readUShort with various values
            byte[] data = new byte[4];
            ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN);
    
            // Test with a positive value
            buffer.putShort(0, (short) 0x1234);
            assertEquals(0x1234, NtlmMessage.readUShort(data, 0), "Should read positive UShort correctly.");
    
            // Test with zero
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb1/ntlmssp/NtlmMessageTest.java

        }
    
        @Test
        @DisplayName("readUShort correctly interprets little endian")
        void testReadUShort() {
            byte[] a = new byte[] { (byte) 0xAA, (byte) 0xBB };
            int result = NtlmMessage.readUShort(a, 0);
            assertEquals(0xBBAA, result, "UShort should be little‑endian");
        }
    
        @Test
        @DisplayName("readUShort throws on too short array")
        void testReadUShortOutOfBounds() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 6.8K bytes
    - Viewed (0)
  3. src/test/java/jcifs/ntlmssp/Type2MessageTest.java

                    // For server: Type 0x0001 (NetBIOS Computer Name)
    
                    // Verify domain part
                    assertEquals(2, Type2Message.readUShort(targetInfo, 0)); // Type 0x0002
                    assertEquals(TEST_DOMAIN.getBytes(Type2Message.UNI_ENCODING).length, Type2Message.readUShort(targetInfo, 2)); // Length
                    assertEquals(TEST_DOMAIN,
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 38.9K bytes
    - Viewed (0)
  4. src/main/java/jcifs/ntlmssp/NtlmMessage.java

        }
    
        static int readUShort(final byte[] src, final int index) {
            return src[index] & 0xff | (src[index + 1] & 0xff) << 8;
        }
    
        static byte[] readSecurityBuffer(final byte[] src, final int index) {
            final int length = readUShort(src, index);
            final int offset = readULong(src, index + 4);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb1/ntlmssp/NtlmMessage.java

        }
    
        static int readUShort(final byte[] src, final int index) {
            return src[index] & 0xff | (src[index + 1] & 0xff) << 8;
        }
    
        static byte[] readSecurityBuffer(final byte[] src, final int index) {
            final int length = readUShort(src, index);
            final int offset = readULong(src, index + 4);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  6. src/main/java/jcifs/pac/PacDataInputStream.java

         * @return the short value in little-endian format
         * @throws IOException if an I/O error occurs
         */
        public short readShort() throws IOException {
            align(2);
            return Short.reverseBytes(this.dis.readShort());
        }
    
        /**
         * Reads a 32-bit integer value with proper alignment and byte order.
         * @return the integer value in little-endian format
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  7. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/ws/WebSocketReader.kt

        // Get frame length, optionally reading from follow-up bytes if indicated by special values.
        frameLength = (b1 and B1_MASK_LENGTH).toLong()
        if (frameLength == PAYLOAD_SHORT.toLong()) {
          frameLength = (source.readShort() and 0xffff).toLong() // Value is unsigned.
        } else if (frameLength == PAYLOAD_LONG.toLong()) {
          frameLength = source.readLong()
          if (frameLength < 0L) {
            throw ProtocolException(
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Jul 29 22:04:11 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  8. src/test/java/jcifs/pac/PacDataInputStreamTest.java

            // Little-endian 0x1234 -> 0x34 0x12
            byte[] data = new byte[] { 0x34, 0x12, 0x00, 0x00 };
            PacDataInputStream pdis = createInputStream(data);
            assertEquals((short) 0x1234, pdis.readShort());
        }
    
        @Test
        public void testReadInt() throws IOException {
            // Little-endian 0x12345678 -> 0x78 0x56 0x34 0x12
            byte[] data = new byte[] { 0x78, 0x56, 0x34, 0x12 };
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/SmbRandomAccessFileTest.java

            assertTrue(raf.readBoolean());
            assertEquals((byte) 0xFF, raf.readByte());
            assertEquals(0xFF, raf.readUnsignedByte());
        }
    
        @Test
        @DisplayName("readShort/UnsignedShort/Char: big-endian decoding")
        void read_twoByteVariants() throws Exception {
            SmbRandomAccessFile raf = spy(newInstance("r", false, false, false));
            doAnswer(inv -> {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  10. src/main/java/jcifs/pac/PacLogonInfo.java

                final PacUnicodeString homeDriveString = pacStream.readUnicodeString();
    
                // Some counts
                this.logonCount = pacStream.readShort();
                this.badPasswordCount = pacStream.readShort();
    
                // IDs for user
                final SID userId = pacStream.readId();
                final SID groupId = pacStream.readId();
    
                // Groups information
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 14.3K bytes
    - Viewed (0)
Back to top