Lines Matching refs:file

5  * you may not use this file except in compliance with the License.
49 // This will fail if the process runs out of file descriptors before
55 for (MemoryFile file : files) {
57 file.readBytes(testString, 0, 0, testString.length);
73 MemoryFile file = new MemoryFile("MemoryFileTest", 1000000);
78 file.writeBytes(testString, 0, 2000, testString.length);
79 file.readBytes(buffer, 2000, 0, testString.length);
85 OutputStream os = file.getOutputStream();
88 InputStream is = file.getInputStream();
99 file.close();
104 MemoryFile file = new MemoryFile("MemoryFileTest", 10);
106 OutputStream os = file.getOutputStream();
116 byte[] copy = new byte[file.length()];
117 file.readBytes(copy, 0, 0, file.length());
125 MemoryFile file = new MemoryFile("MemoryFileTest", testString.length);
127 file.writeBytes(testString, 0, 0, testString.length);
128 InputStream is = file.getInputStream();
139 file.close();
167 // Test behavior of read() at end of file
170 MemoryFile file = new MemoryFile("MemoryFileTest", testString.length);
172 file.writeBytes(testString, 0, 0, testString.length);
173 InputStream is = file.getInputStream();
185 file.close();
192 MemoryFile file = new MemoryFile("MemoryFileTest", 1000000);
194 file.writeBytes(data, 0, 0, 128);
195 file.close();
196 file.close();
199 // Tests that we can't read from a closed memory file
202 MemoryFile file = new MemoryFile("MemoryFileTest", 1000000);
203 file.close();
207 assertEquals(128, file.readBytes(data, 0, 0, 128));
214 // Tests that we can't write to a closed memory file
217 MemoryFile file = new MemoryFile("MemoryFileTest", 1000000);
218 file.close();
222 file.writeBytes(data, 0, 0, 128);
232 MemoryFile file = new MemoryFile("MemoryFileTest", 1000000);
234 file.writeBytes(data, 0, 0, 128);
235 file.close();
238 file.allowPurging(true);
245 // Tests that we don't leak file descriptors or mmap areas
249 // file descriptors or address space if we leak either.
251 MemoryFile file = new MemoryFile("MemoryFileTest", 5000000);
252 file.writeBytes(testString, 0, 0, testString.length);
253 file.close();