MCPcopy Create free account
hub / github.com/spotbugs/spotbugs / main

Method main

spotbugsTestCases/src/java/FindRRTest.java:5–31  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

3
4public class FindRRTest {
5 public static void main(String[] args) throws Exception {
6 BufferedInputStream bis = null;
7 try {
8 byte[] buffer = new byte[100];
9 for (int i = 0; i < 100; i++)
10 buffer[i] = (byte) i;
11 ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
12 bis = new BufferedInputStream(bais, 50);
13
14 byte[] smallBuf = new byte[10];
15
16 bis.read(smallBuf);
17 System.out.println(bis.available());
18 long s = bis.skip(50);
19 System.out.println(s);
20 bis.read(smallBuf);
21
22 System.out.println(smallBuf[0]);
23 if (smallBuf[0] == 60)
24 System.out.println("It works");
25 else
26 throw new Exception("Better check the size returned by skip(): read " + smallBuf[0]);
27 } finally {
28 if (bis != null)
29 bis.close();
30 }
31 }
32
33}

Callers

nothing calls this directly

Calls 4

closeMethod · 0.65
readMethod · 0.45
printlnMethod · 0.45
skipMethod · 0.45

Tested by

no test coverage detected