@Test public void testGetTempSharedFileInputStream () throws Exception { final String inData = "123456"; try (final InputStream is = new NonBlockingByteArrayInputStream (inData.getBytes ()); final SharedFileInputStream sis = TempSharedFileInputStream.getTempSharedFileInputStream (is, "myName"); final NonBlockingByteArrayOutputStream baos = new NonBlockingByteArrayOutputStream ()) { StreamHelper.copyInputStreamToOutputStream (sis, baos); final String res = baos.getAsString (StandardCharsets.ISO_8859_1); assertEquals ("read the data", inData, res); sis.close (); } }
@Nonnull public static TempSharedFileInputStream getTempSharedFileInputStream (@Nonnull @WillClose final InputStream aIS, @Nonnull final String sName) throws IOException { final File aDest = storeContentToTempFile (aIS, sName); return new TempSharedFileInputStream (aDest); }
TempSharedFileInputStream extends SharedFileInputStream { @Nonnull public static TempSharedFileInputStream getTempSharedFileInputStream (@Nonnull @WillClose final InputStream aIS, @Nonnull final String sName) throws IOException { final File aDest = storeContentToTempFile (aIS, sName); return new TempSharedFileInputStream (aDest); } }
TempSharedFileInputStream extends SharedFileInputStream { @Nonnull public static TempSharedFileInputStream getTempSharedFileInputStream (@Nonnull @WillClose final InputStream aIS, @Nonnull final String sName) throws IOException { final File aDest = storeContentToTempFile (aIS, sName); return new TempSharedFileInputStream (aDest); } private  TempSharedFileInputStream(@Nonnull final File aFile); }
TempSharedFileInputStream extends SharedFileInputStream { @Nonnull public static TempSharedFileInputStream getTempSharedFileInputStream (@Nonnull @WillClose final InputStream aIS, @Nonnull final String sName) throws IOException { final File aDest = storeContentToTempFile (aIS, sName); return new TempSharedFileInputStream (aDest); } private  TempSharedFileInputStream(@Nonnull final File aFile); @Override void close(); void closeAll(); @Nonnull static TempSharedFileInputStream getTempSharedFileInputStream(@Nonnull @WillClose final InputStream aIS,
                                                                        @Nonnull final String sName); }
TempSharedFileInputStream extends SharedFileInputStream { @Nonnull public static TempSharedFileInputStream getTempSharedFileInputStream (@Nonnull @WillClose final InputStream aIS, @Nonnull final String sName) throws IOException { final File aDest = storeContentToTempFile (aIS, sName); return new TempSharedFileInputStream (aDest); } private  TempSharedFileInputStream(@Nonnull final File aFile); @Override void close(); void closeAll(); @Nonnull static TempSharedFileInputStream getTempSharedFileInputStream(@Nonnull @WillClose final InputStream aIS,
                                                                        @Nonnull final String sName);  }