#vulnerable code 
                              @Test
  public void testExternalStreamButNoByteArrayOutputStream() throws Exception {
    final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    final DataOutputStream dout = new DataOutputStream(buffer);
    
    assertNull(binStart(dout).Byte(1,2,3).end());
    assertArrayEquals(new byte[]{1,2,3}, buffer.toByteArray());
  } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void testExternalStreamButNoByteArrayOutputStream() throws Exception {
    final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    final DataOutputStream dout = new DataOutputStream(buffer);
    
    assertNull(BeginBin(dout).Byte(1,2,3).End());
    assertArrayEquals(new byte[]{1,2,3}, buffer.toByteArray());
  }