@Test public void testPartialReadSave() throws IOException { SaveOnReadInputStream soris = getSaveOnReadInputStream(); InputStreamFactory isf = soris.getInputStreamFactory(); InputStream is = isf.getInputStream(); is.read(); InputStream is2 = isf.getInputStream(); assertEquals("ello world", new String(ObjectConverterUtil.convertToByteArray(is), Streamable.CHARSET)); assertEquals("hello world", new String(ObjectConverterUtil.convertToByteArray(is2), Streamable.CHARSET)); InputStream is3 = isf.getInputStream(); assertEquals("hello world", new String(ObjectConverterUtil.convertToByteArray(is3), Streamable.CHARSET)); }
((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
((BaseLob) value).setStreamFactory(is.getInputStreamFactory()); } else { initial.close();
@Test public void testSave() throws IOException { SaveOnReadInputStream soris = getSaveOnReadInputStream(); InputStreamFactory isf = soris.getInputStreamFactory(); InputStream is = isf.getInputStream(); assertEquals("hello world", new String(ObjectConverterUtil.convertToByteArray(is), Streamable.CHARSET)); InputStream is2 = isf.getInputStream(); assertEquals("hello world", new String(ObjectConverterUtil.convertToByteArray(is2), Streamable.CHARSET)); }
@Test public void testStorageMode() throws IOException { SaveOnReadInputStream soris = getSaveOnReadInputStream(); InputStreamFactory isf = soris.getInputStreamFactory(); assertEquals(StorageMode.MEMORY, isf.getStorageMode()); InputStream is = isf.getInputStream(); assertEquals("hello world", new String(ObjectConverterUtil.convertToByteArray(is), Streamable.CHARSET)); }
context.addCreatedLob(fsisf); return asLob(is.getInputStreamFactory(), desiredType); } catch (IOException e) { throw new TransformationException(QueryPlugin.Event.TEIID30500, e, e.getMessage()); final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(is, fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf); final FileStore fs = bm.createFileStore("xml"); //$NON-NLS-1$ final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(new XMLInputStream(ss, XMLSystemFunctions.getOutputFactory(true)), fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf);
context.addCreatedLob(fsisf); return asLob(is.getInputStreamFactory(), desiredType); } catch (IOException e) { throw new TransformationException(QueryPlugin.Event.TEIID30500, e, e.getMessage()); final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(is, fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf); final FileStore fs = bm.createFileStore("xml"); //$NON-NLS-1$ final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(new XMLInputStream(ss, XMLSystemFunctions.getOutputFactory(true)), fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf);
context.addCreatedLob(fsisf); return new BlobType(new BlobImpl(is.getInputStreamFactory())); } catch (IOException e) { throw new TransformationException(QueryPlugin.Event.TEIID30500, e, e.getMessage()); final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(is, fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf); final FileStore fs = bm.createFileStore("xml"); //$NON-NLS-1$ final FileStoreInputStreamFactory fsisf = new FileStoreInputStreamFactory(fs, Streamable.ENCODING); value = new SaveOnReadInputStream(new XMLInputStream(ss, XMLSystemFunctions.getOutputFactory(true)), fsisf).getInputStreamFactory(); if (context != null) { context.addCreatedLob(fsisf);