### Question:
LargeText { public long writeLogTo(long start, Writer w) throws IOException { return writeLogTo(start, new WriterOutputStream(w, charset)); } LargeText(File file, boolean completed);  LargeText(File file, boolean completed, boolean transparentGunzip);  LargeText(final File file, Charset charset, boolean completed);  LargeText(final File file, Charset charset, boolean completed, boolean transparentGunzip);  LargeText(ByteBuffer memory, boolean completed);  LargeText(final ByteBuffer memory, Charset charset, boolean completed); void markAsComplete(); boolean isComplete(); long length(); Reader readAll(); long writeLogTo(long start, Writer w); long writeLogTo(long start, OutputStream out); void doProgressText(StaplerRequest req, StaplerResponse rsp);  }### Answer:
@Issue("JENKINS-37664") @Test public void writeLogTo() throws Exception { assertEquals("", tail("", 0)); assertEquals("abcde", tail("abcde", 0)); assertEquals("de", tail("abcde", 3)); assertEquals("", tail("abcde", 5)); try { fail(tail("abcde", 6)); } catch (EOFException x) { } try { fail(tail("abcde", 99)); } catch (EOFException x) { } }
@Issue("#141") @Test @Ignore public void writeLogToWithLargeFile() throws Exception { Path path = Files.createTempFile("stapler-test", ".log.gz"); long size = Integer.MAX_VALUE + 256L; writeLargeFile(path, size); LargeText t = new LargeText(path.toFile(), StandardCharsets.US_ASCII, true); try (OutputStream os = new NullOutputStream()) { long writenCount = t.writeLogTo(0, os); assertEquals(size, writenCount); } Files.delete(path); }