@Override public void writeTo(Writer out) throws IOException { writeToImpl(out, start, end); }
@Override public void writeTo(Encoder encoder, Writer out, long off, long len) throws IOException { writeTo( encoder!=null ? new EncoderWriter(encoder, out) : out, off, len ); }
@Override public BufferResult getResult() throws IllegalStateException { if(!isClosed) throw new IllegalStateException(); if(result==null) { if(length==0) { result = EmptyResult.getInstance(); } else { result = new TempFileResult(tempFile, 0, length); } } return result; } }
@Override public void writeTo(Encoder encoder, Writer out) throws IOException { writeTo( encoder!=null ? new EncoderWriter(encoder, out) : out ); }
} else { return new TempFileResult( tempFile, newStart,
@Override public void writeTo(Writer out, long off, long len) throws IOException { if((start + off + len) > end) throw new IndexOutOfBoundsException(); writeToImpl(out, start + off, start + off + len); }