Searched refs:dataSink (Results 1 – 6 of 6) sorted by relevance
36 protected ByteBuffer getContents(ReadableDataSink dataSink) throws IOException { in getContents() argument37 if (dataSink.size() > Integer.MAX_VALUE) { in getContents()38 throw new IOException("Too much data: " + dataSink.size()); in getContents()40 return dataSink.getByteBuffer(0, (int) dataSink.size()); in getContents()
44 protected abstract ByteBuffer getContents(T dataSink) throws IOException; in getContents() argument136 private CloseableWithDataSink(T dataSink, Closeable closeable) { in CloseableWithDataSink() argument137 mDataSink = dataSink; in CloseableWithDataSink()141 public static <T extends DataSink> CloseableWithDataSink<T> of(T dataSink) { in of() argument142 return new CloseableWithDataSink<>(dataSink, null); in of()146 T dataSink, Closeable closeable) { in of() argument147 return new CloseableWithDataSink<>(dataSink, closeable); in of()
39 protected ByteBuffer getContents(OutputStreamDataSink dataSink) throws IOException { in getContents() argument40 return ByteBuffer.wrap(((ByteArrayOutputStream) dataSink.getOutputStream()).toByteArray()); in getContents()
51 protected ByteBuffer getContents(RandomAccessFileDataSink dataSink) throws IOException { in getContents() argument52 RandomAccessFile f = dataSink.getFile(); in getContents()
40 protected ByteBuffer getContents(ByteBufferSink dataSink) throws IOException { in getContents() argument41 ByteBuffer buf = dataSink.getBuffer(); in getContents()
172 public void writeToDataSink(DataSink dataSink) throws IOException { in writeToDataSink() argument173 if (dataSink == null) { in writeToDataSink()176 dataSink.consume(write()); in writeToDataSink()