### Question:
ServerInputStream extends UnicastExportable implements RemoteInputStream, Closeable { public int read() throws IOException { return in.read(); } ServerInputStream(InputStream in, Exporter exporter); int read(); PartialBuffer read(int len); long skip(long n); void close(); @Override void unreferenced();  }### Answer:
@Test public void testRead() throws IOException { bi.reset(); try { si.read(-1); fail("Failed to throw exception for read with negative length"); } catch (Exception e) { } PartialBuffer pb = si.read(0); assertNotNull(pb); assertEquals(0, pb.getLength()); assertEquals(0, pb.getOffset()); pb = si.read(1); assertNotNull(pb); assertEquals(1, pb.getLength()); assertEquals(0, pb.getOffset()); assertEquals(buf[0], pb.getBuffer()[0]); pb = si.read(10); assertNotNull(pb); assertEquals(10, pb.getLength()); assertEquals(0, pb.getOffset()); for (int i = 0; i < 10; i++) assertEquals(buf[i + 1], pb.getBuffer()[i]); pb = si.read(10); assertNull(pb); }
@Test public void testReadInt() throws IOException { bi.reset(); for (byte b : buf) assertEquals(b, si.read()); assertEquals(-1, si.read()); }