@Override public synchronized InputStream getStream() { if(data != null){ return new ByteArrayInputStream(data); } if(consumed){ throw new IllegalStateException("This InputStream of this ContentSource is already consumed!"); } consumed = true; return new NonCloseableInputStream(in); } @Override
@Override public synchronized InputStream getStream() { if(data != null){ return new ByteArrayInputStream(data); } if(consumed){ throw new IllegalStateException("This InputStream of this ContentSource is already consumed!"); } consumed = true; return new NonCloseableInputStream(in); } @Override