@Override public InputStream getInputStream() throws IOException { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); writeTo(bout); return bout.createInputStream(); } @Override
public AbstractThresholdOutputStream(int threshold) { this.threshold = threshold; if (threshold >= 0) { buffer = new LoadingByteArrayOutputStream(threshold + 1); } }
public AbstractThresholdOutputStream(int threshold) { this.threshold = threshold; if (threshold >= 0) { buffer = new LoadingByteArrayOutputStream(threshold + 1); } }
public AbstractThresholdOutputStream(int threshold) { this.threshold = threshold; if (threshold >= 0) { buffer = new LoadingByteArrayOutputStream(threshold + 1); } }
public AbstractThresholdOutputStream(int threshold) { this.threshold = threshold; if (threshold >= 0) { buffer = new LoadingByteArrayOutputStream(threshold + 1); } }
public CachedOutputStream(long threshold) { this.threshold = threshold; currentStream = new LoadingByteArrayOutputStream(2048); inmem = true; readBusProperties(); }
public CachedOutputStream(long threshold) { this.threshold = threshold; currentStream = new LoadingByteArrayOutputStream(2048); inmem = true; readBusProperties(); }
public CachedOutputStream(long threshold) { this.threshold = threshold; currentStream = new LoadingByteArrayOutputStream(2048); inmem = true; readBusProperties(); }
public CachedOutputStream(long threshold) { this.threshold = threshold; currentStream = new LoadingByteArrayOutputStream(2048); inmem = true; readBusProperties(); }
private void maybeDeleteTempFile(Object stream) { streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } }
private void maybeDeleteTempFile(Object stream) { streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } }
public InputStream serialiseAcknowledgment(SequenceAcknowledgement ack) { LoadingByteArrayOutputStream bos = new LoadingByteArrayOutputStream(); try { getContext().createMarshaller().marshal(ack, bos); } catch (JAXBException ex) { throw new RMStoreException(ex); } return bos.createInputStream(); }
/** * Load the InputStream into memory and return a ByteArrayInputStream that * represents it. Closes the in stream. * * @param in * @throws IOException */ public static ByteArrayInputStream loadIntoBAIS(InputStream in) throws IOException { int i = in.available(); if (i < DEFAULT_BUFFER_SIZE) { i = DEFAULT_BUFFER_SIZE; } LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(i); copy(in, bout); in.close(); return bout.createInputStream(); }
@Override public InputStream getInputStream() throws IOException { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); writeTo(bout); return bout.createInputStream(); } @Override
public static void convertObjectToSource(Message message) { List<Object> content = CastUtils.cast(message.getContent(List.class)); if (content == null || content.size() < 1) { // nothing to convert return; } // only supporting the wrapped style for now (one pojo <-> one source) Object object = content.get(0); DataWriter<OutputStream> writer = message.getExchange().getService().getDataBinding().createWriter(OutputStream.class); LoadingByteArrayOutputStream bos = new LoadingByteArrayOutputStream(); writer.write(object, bos); content.set(0, new StreamSource(bos.createInputStream())); }
public static void convertObjectToSource(Message message) { List<Object> content = CastUtils.cast(message.getContent(List.class)); if (content == null || content.size() < 1) { // nothing to convert return; } // only supporting the wrapped style for now (one pojo <-> one source) Object object = content.get(0); DataWriter<OutputStream> writer = message.getExchange().getService().getDataBinding().createWriter(OutputStream.class); LoadingByteArrayOutputStream bos = new LoadingByteArrayOutputStream(); writer.write(object, bos); content.set(0, new StreamSource(bos.createInputStream())); }
public void onMessage(Message message) { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); try { IOUtils.copy(message.getContent(InputStream.class), bout); message.getExchange().put(InputStream.class, bout.createInputStream()); c.close(message); } catch (IOException e) { //ignore } } });
public void onMessage(Message message) { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); try { IOUtils.copy(message.getContent(InputStream.class), bout); message.getExchange().put(InputStream.class, bout.createInputStream()); c.close(message); } catch (IOException e) { //ignore } } });
public void onMessage(Message message) { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); try { IOUtils.copy(message.getContent(InputStream.class), bout); message.getExchange().put(InputStream.class, bout.createInputStream()); c.close(message); } catch (IOException e) { //ignore } } });
public void onMessage(Message message) { LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream(); try { IOUtils.copy(message.getContent(InputStream.class), bout); message.getExchange().put(InputStream.class, bout.createInputStream()); c.close(message); } catch (IOException e) { //ignore } } });