### Question:
ServerOutputStream extends UnicastExportable implements RemoteOutputStream, Closeable { public void write(int b) throws IOException { out.write(b); } ServerOutputStream(OutputStream out, Exporter exporter); void write(int b); void write(byte[] b); void write(PartialBuffer b); void flush(); void close(); @Override void unreferenced();  }### Answer:
@Test public void testWriteInt() throws IOException { bo.reset(); so.write('a'); byte[] b = bo.toByteArray(); assertNotNull(b); assertEquals(1, b.length); assertEquals('a', b[0]); }
@Test public void testWriteByteArray() throws IOException { bo.reset(); byte[] in = "Hello World".getBytes(); so.write(in); byte[] b = bo.toByteArray(); assertNotNull(b); assertEquals(in, b); bo.reset(); in = new byte[0]; so.write(in); b = bo.toByteArray(); assertNotNull(b); assertEquals(in, b); }
@Test public void testWritePartialBuffer() throws IOException { bo.reset(); byte[] in = "Hello World".getBytes(); PartialBuffer pb = new PartialBuffer(new byte[in.length * 3], in.length, in.length); System.arraycopy(in, 0, pb.getBuffer(), pb.getOffset(), pb.getLength()); so.write(pb); byte[] b = bo.toByteArray(); assertNotNull(b); assertEquals(in, b); }