Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 19 of 19 for getCapacity (0.84 seconds)

  1. src/main/java/jcifs/dcerpc/ndr/NdrBuffer.java

        public void setIndex(final int index) {
            this.index = index;
        }
    
        /**
         * Returns the capacity of the buffer.
         *
         * @return the buffer capacity
         */
        public int getCapacity() {
            return this.buf.length - this.start;
        }
    
        /**
         * Returns the available space at the tail of the buffer.
         *
         * @return the available tail space
         */
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 10.7K bytes
    - Click Count (0)
  2. src/test/java/jcifs/internal/fscc/FileFsSizeInformationTest.java

                // When
                fileFsSizeInfo.decode(buffer.array(), 0, 24);
                double percentFree = (fileFsSizeInfo.getFree() * 100.0) / fileFsSizeInfo.getCapacity();
                double percentUsed = ((fileFsSizeInfo.getCapacity() - fileFsSizeInfo.getFree()) * 100.0) / fileFsSizeInfo.getCapacity();
    
                // Then
                assertEquals(25.0, percentFree, 0.001);
                assertEquals(75.0, percentUsed, 0.001);
            }
        }
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 25.9K bytes
    - Click Count (0)
  3. src/test/java/jcifs/internal/smb1/trans2/Trans2QueryFSInformationResponseTest.java

            assertTrue(response.getInfo() instanceof SmbInfoAllocation);
    
            SmbInfoAllocation info = (SmbInfoAllocation) response.getInfo();
            assertEquals(8L * 1000000L * 512L, info.getCapacity());
            assertEquals(8L * 500000L * 512L, info.getFree());
        }
    
        @Test
        void testReadDataWireFormat_FileFsSizeInformation() throws Exception {
            // Test reading FS_SIZE_INFO data
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 17.9K bytes
    - Click Count (0)
  4. src/test/java/jcifs/internal/fscc/FileFsFullSizeInformationTest.java

                double percentFree = (fileFsFullSizeInfo.getFree() * 100.0) / fileFsFullSizeInfo.getCapacity();
                double percentUsed =
                        ((fileFsFullSizeInfo.getCapacity() - fileFsFullSizeInfo.getFree()) * 100.0) / fileFsFullSizeInfo.getCapacity();
    
                // Then
                assertEquals(25.0, percentFree, 0.001);
                assertEquals(75.0, percentUsed, 0.001);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 30.5K bytes
    - Click Count (0)
  5. src/test/java/jcifs/internal/fscc/FileSystemInformationTest.java

                assertEquals(4L * 8192L * 1024L, smbInfoAllocation.getCapacity());
            }
    
            @Test
            @DisplayName("Should handle zero values")
            void testZeroValues() throws SMBProtocolDecodingException {
                byte[] buffer = new byte[24];
    
                smbInfoAllocation.decode(buffer, 0, buffer.length);
    
                assertEquals(0, smbInfoAllocation.getCapacity());
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 18.1K bytes
    - Click Count (0)
  6. src/test/java/jcifs/smb1/smb1/Trans2QueryFSInformationResponseTest.java

            assertEquals(1000, info.alloc);
            assertEquals(500, info.free);
            assertEquals(100, info.sectPerAlloc);
            assertEquals(512, info.bytesPerSect);
            assertEquals(1000L * 100 * 512, info.getCapacity(), "Capacity calculation should be correct");
            assertEquals(500L * 100 * 512, info.getFree(), "Free space calculation should be correct");
        }
    
        /**
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.6K bytes
    - Click Count (0)
  7. src/test/java/jcifs/dcerpc/ndr/NdrBufferTest.java

            assertEquals(50, ndrBuffer.getIndex());
        }
    
        @Test
        void testGetCapacity() {
            assertEquals(buffer.length, ndrBuffer.getCapacity());
    
            NdrBuffer offsetBuffer = new NdrBuffer(buffer, 100);
            assertEquals(buffer.length - 100, offsetBuffer.getCapacity());
        }
    
        @Test
        void testGetTailSpace() {
            ndrBuffer.setIndex(100);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 14.3K bytes
    - Click Count (0)
  8. src/main/java/jcifs/smb/SmbFile.java

            }
    
            try (SmbTreeHandleImpl th = ensureTreeConnected()) {
                final int t = getType();
                if (t == TYPE_SHARE) {
                    this.size = fetchAllocationInfo(th).getCapacity();
                } else if (!this.fileLocator.isRoot() && t != TYPE_NAMED_PIPE) {
                    queryPath(th, this.fileLocator.getUNCPath(), FileInformation.FILE_STANDARD_INFO);
                } else {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 103.2K bytes
    - Click Count (0)
  9. src/main/java/jcifs/smb1/smb1/SmbFile.java

                response = new Trans2QueryFSInformationResponse(level);
                send(new Trans2QueryFSInformation(level), response);
    
                size = response.info.getCapacity();
            } else if (getUncPath0().length() > 1 && type != TYPE_NAMED_PIPE) {
                final Info info = queryPath(getUncPath0(), Trans2QueryPathInformationResponse.SMB_QUERY_FILE_STANDARD_INFO);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 05:58:03 GMT 2025
    - 112.2K bytes
    - Click Count (0)
Back to Top