Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 5 of 5 for isInMemory (0.27 seconds)

  1. src/main/java/org/codelibs/curl/io/ContentOutputStream.java

         */
        @Override
        public void close() throws IOException {
            try {
                super.close();
            } finally {
                if (!isInMemory() && !done) {
                    final File file = super.getFile();
                    if (file != null) {
                        try {
                            Files.deleteIfExists(file.toPath());
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Thu Nov 20 13:34:13 GMT 2025
    - 3.9K bytes
    - Click Count (0)
  2. src/main/java/org/codelibs/curl/io/ContentCache.java

            this.file = file;
        }
    
        /**
         * Returns whether the content is cached in memory.
         *
         * @return true if the content is in memory, false if it is in a file
         */
        public boolean isInMemory() {
            return data != null;
        }
    
        /**
         * Returns the content as a byte array.
         * If the content is cached in memory, a clone of the data is returned.
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 09:11:12 GMT 2026
    - 4.8K bytes
    - Click Count (0)
  3. src/test/java/org/codelibs/curl/io/ContentCacheTest.java

            }
        }
    
        // --- isInMemory() tests ---
    
        @Test
        public void testIsInMemory_WithByteArray() {
            // ## Arrange ##
            ContentCache cache = new ContentCache("test".getBytes());
    
            // ## Assert ##
            assertTrue(cache.isInMemory());
        }
    
        @Test
        public void testIsInMemory_WithFile() throws IOException {
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 09:11:12 GMT 2026
    - 15.9K bytes
    - Click Count (0)
  4. src/test/java/org/codelibs/curl/io/ContentOutputStreamTest.java

            cos.write(new byte[] { 0, 1, 2 });
            assertTrue(cos.isInMemory());
            cos.write(new byte[] { 3, 4 });
            assertTrue(cos.isInMemory());
            cos.write(new byte[] { 5 });
            assertTrue(cos.isInMemory());
            assertFalse(cos.done);
            cos.close();
        }
    
        @Test
        public void testMultipleWritesExceedingThreshold() throws IOException {
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 12:00:34 GMT 2026
    - 11.7K bytes
    - Click Count (0)
  5. src/main/java/org/codelibs/curl/CurlRequest.java

                    }
                    dfos.flush();
                    final ContentCache contentCache;
                    logger.fine(() -> "Response in " + (dfos.isInMemory() ? "Memory" : "File"));
                    if (dfos.isInMemory()) {
                        contentCache = new ContentCache(dfos.getData());
                    } else {
                        contentCache = new ContentCache(dfos.getFile());
                    }
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Sat Mar 21 09:11:12 GMT 2026
    - 19.7K bytes
    - Click Count (0)
Back to Top