/** * The returned output stream is shared among all uses. * Once closed no further writing can occur * @return */ public FileStoreOutputStream getOuputStream(int maxMemorySize) { if (fsos == null) { fsos = lobBuffer.createOutputStream(maxMemorySize); } return fsos; }
/** * The returned output stream is shared among all uses. * Once closed no further writing can occur * @return */ public FileStoreOutputStream getOuputStream(int maxMemorySize) { if (fsos == null) { fsos = lobBuffer.createOutputStream(maxMemorySize); } return fsos; }
/** * The returned output stream is shared among all uses. * Once closed no further writing can occur * @return */ public FileStoreOutputStream getOuputStream(int maxMemorySize) { if (fsos == null) { fsos = lobBuffer.createOutputStream(maxMemorySize); } return fsos; }
StreamFactoryReference sfr = streams.get(streamIndex); sfr.setStreamFactory(new FileStoreInputStreamFactory(store, Streamable.ENCODING)); this.stream = new BufferedOutputStream(store.createOutputStream());
OutputStream out = store.createOutputStream(); out.write(contentOrig.getBytes(), 0, contentOrig.getBytes().length); out.close(); out = store.createOutputStream(); long start = store.getLength(); byte[] bytesOrig = new byte[2048];
@Test public void testClose() throws Exception { FileStorageManager sm = getStorageManager(null, null); FileStore store = sm.createFileStore("0"); FileStoreOutputStream fsos = store.createOutputStream(2); fsos.write(new byte[100000]); fsos.close(); fsos.close(); }
@Test public void testFlush() throws Exception { FileStorageManager sm = getStorageManager(null, null); FileStore store = sm.createFileStore("0"); FileStoreOutputStream fsos = store.createOutputStream(2); fsos.write(new byte[3]); fsos.write(1); fsos.flush(); assertEquals(0, fsos.getCount()); }
@Test public void testGrowth() throws Exception { FileStorageManager sm = getStorageManager(null, null); FileStore store = sm.createFileStore("0"); FileStoreOutputStream fsos = store.createOutputStream(1<<15); assertTrue(fsos.getBuffer().length < 1<<15); fsos.write(1); fsos.write(new byte[1<<14]); fsos.flush(); assertEquals(1 + (1<<14), fsos.getCount()); assertEquals(1<<15, fsos.getBuffer().length); }
OutputStream fsos = store.createOutputStream(); byteLength = ObjectConverterUtil.write(fsos, is, bytes, -1);
OutputStream fsos = store.createOutputStream(); byteLength = ObjectConverterUtil.write(fsos, is, bytes, -1);
OutputStream fsos = store.createOutputStream(); byteLength = ObjectConverterUtil.write(fsos, is, bytes, -1);