Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for readStringLength (0.26 sec)

  1. src/main/java/jcifs/smb1/smb1/SmbComTreeConnectAndXResponse.java

            return 2;
        }
    
        @Override
        int readBytesWireFormat(final byte[] buffer, int bufferIndex) {
            final int start = bufferIndex;
    
            final int len = readStringLength(buffer, bufferIndex, 32);
            try {
                service = new String(buffer, bufferIndex, len, "ASCII");
            } catch (final UnsupportedEncodingException uee) {
                return 0;
            }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/smb1/ServerMessageBlockTest.java

                assertEquals(4, testBlock.readStringLength(buffer, 0, 10));
            }
    
            @Test
            @DisplayName("Test read string length without termination throws exception")
            void testReadStringLengthNoTermination() {
                byte[] buffer = "TestTest".getBytes();
    
                assertThrows(RuntimeCIFSException.class, () -> {
                    testBlock.readStringLength(buffer, 0, 3);
                });
            }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 36.2K bytes
    - Viewed (0)
  3. src/main/java/jcifs/internal/smb1/com/SmbComTreeConnectAndXResponse.java

            return 2;
        }
    
        @Override
        protected int readBytesWireFormat(final byte[] buffer, int bufferIndex) {
            final int start = bufferIndex;
    
            final int len = readStringLength(buffer, bufferIndex, 32);
            try {
                this.service = new String(buffer, bufferIndex, len, "ASCII");
            } catch (final UnsupportedEncodingException uee) {
                return 0;
            }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb1/smb1/ServerMessageBlock.java

            int len = str.length() + 1;
            if (useUnicode) {
                len = str.length() * 2 + 2;
                len = offset % 2 != 0 ? len + 1 : len;
            }
            return len;
        }
    
        int readStringLength(final byte[] src, final int srcIndex, final int max) {
            int len = 0;
            while (src[srcIndex + len] != (byte) 0x00) {
                if (len++ > max) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  5. src/main/java/jcifs/internal/smb1/ServerMessageBlock.java

         * @param srcIndex the starting offset in the buffer
         * @param max the maximum number of bytes to scan
         * @return the length of the string in bytes
         */
        protected int readStringLength(final byte[] src, final int srcIndex, final int max) {
            int len = 0;
            while (src[srcIndex + len] != (byte) 0x00) {
                if (len++ > max) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 38.9K bytes
    - Viewed (0)
Back to top