@Override public InputStream getInputStream() throws IOException { return new FastBufferInputStream(content); }
@Override public InputStream getInputStream() throws IOException { checkNotDeleted(); return new FastBufferInputStream(buffer); }
@Override public InputStream getInputStream() throws IOException { checkNotDeleted(); return new FastBufferInputStream(buffer); }
public InputStream getWrittenDataAsStream() throws IOException { flushBuffers(); if (stream != null) { ByteBuffer firstBuffer = stream.getFirstBuffer(); firstBuffer.compact(); return new FastBufferInputStream(firstBuffer); } else { return EMPTY_STREAM; } }
public InputStream getInputStream() throws IOException { FastBufferOutputStream fbos = new FastBufferOutputStream(); ImageOutputStream imageOutputStream = ImageIO.createImageOutputStream(fbos); try { paintAndWrite(imageOutputStream); } finally { if (imageOutputStream != null) { try { imageOutputStream.close(); } catch (IOException e) { LOGGER.debug(e.getMessage(), e); } try { fbos.close(); } catch (IOException e) { // Swallow } } } ByteBuffer buffer = fbos.getFirstBuffer(); buffer.compact(); return new FastBufferInputStream(buffer); }