Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for fromUNIBytes (0.57 sec)

  1. src/test/java/jcifs/util/StringsTest.java

        class UnicodeDecodingTests {
    
            @Test
            @DisplayName("fromUNIBytes should decode UTF-16LE bytes to string")
            void testFromUNIBytes() {
                // Given
                byte[] bytes = TEST_STRING.getBytes(StandardCharsets.UTF_16LE);
    
                // When
                String result = Strings.fromUNIBytes(bytes, 0, bytes.length);
    
                // Then
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.6K bytes
    - Viewed (0)
  2. src/main/java/jcifs/internal/fscc/FileBothDirectoryInfo.java

            this.eaSize = SMBUtil.readInt4(buffer, bufferIndex);
            bufferIndex += 4;
    
            final int shortNameLength = buffer[bufferIndex] & 0xFF;
            bufferIndex += 2;
    
            this.shortName = Strings.fromUNIBytes(buffer, bufferIndex, shortNameLength);
            bufferIndex += 24;
    
            String str;
            if (this.unicode) {
                if (fileNameLength > 0 && buffer[bufferIndex + fileNameLength - 1] == '\0'
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 6K bytes
    - Viewed (0)
  3. src/main/java/jcifs/internal/smb1/trans/nt/FileNotifyInformationImpl.java

            this.action = SMBUtil.readInt4(buffer, bufferIndex);
            bufferIndex += 4;
    
            this.fileNameLength = SMBUtil.readInt4(buffer, bufferIndex);
            bufferIndex += 4;
    
            this.fileName = Strings.fromUNIBytes(buffer, bufferIndex, this.fileNameLength);
            bufferIndex += this.fileNameLength;
            return bufferIndex - start;
        }
    
        @Override
        public String toString() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  4. src/main/java/jcifs/internal/dfs/Referral.java

            // this is not absolutely correct, but we assume that the header is aligned
            if (bufferIndex % 2 != 0) {
                bufferIndex++;
            }
            return Strings.fromUNIBytes(buffer, bufferIndex, Strings.findUNITermination(buffer, bufferIndex, len));
        }
    
        @Override
        public String toString() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  5. src/main/java/jcifs/util/Strings.java

         * @param srcIndex the starting offset in the byte array
         * @param len the number of bytes to decode
         * @return decoded string
         */
        public static String fromUNIBytes(final byte[] src, final int srcIndex, final int len) {
            return new String(src, srcIndex, len, UNI_ENCODING);
        }
    
        /**
         * Finds the null termination in a UTF-16LE encoded string buffer.
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  6. src/main/java/jcifs/internal/smb1/com/SmbComNegotiateResponse.java

                        len = Strings.findUNITermination(buffer, bufferIndex, 256);
                        this.server.oemDomainName = Strings.fromUNIBytes(buffer, bufferIndex, len);
                    } else {
                        len = Strings.findTermination(buffer, bufferIndex, 256);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  7. src/main/java/jcifs/dcerpc/ndr/NdrBuffer.java

                len--;
                final int size = len * 2;
                if (size < 0 || size > 0xFFFF) {
                    throw new NdrException(NdrException.INVALID_CONFORMANCE);
                }
                val = Strings.fromUNIBytes(this.buf, i, size);
                i += size + 2;
            }
            advance(i - this.index);
            return val;
        }
    
        private int getDceReferent(final Object obj) {
            Entry e;
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 10.7K bytes
    - Viewed (0)
  8. src/main/java/jcifs/internal/smb1/ServerMessageBlock.java

            if (unicode) {
                // Unicode requires word alignment
                if ((srcIndex - this.headerStart) % 2 != 0) {
                    srcIndex++;
                }
                return Strings.fromUNIBytes(src, srcIndex, Strings.findUNITermination(src, srcIndex, maxLen));
            }
    
            return Strings.fromOEMBytes(src, srcIndex, Strings.findTermination(src, srcIndex, maxLen), getConfig());
        }
    
        /**
    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