code: private byte[] getBytes(DistributableWork dw)
     {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = null;
        try
        {
           oos = new ObjectOutputStream(baos);
           oos.writeObject(dw);
           oos.flush();
           return baos.toByteArray();
        }
        catch (Throwable t)
        {
           log.error("Error during getBytes: " + t.getMessage(), t);
        }
        finally
        {
           if (oos != null)
           {
              try
              {
                 oos.close();
              }
              catch (IOException ioe)
              {
                 // Ignore
              }
           }
        }
  
        return null;
     }
docs: Get the byte[] of a DistributableWork instance
  @param dw The instance
  @return The value