public static byte[] domainControllerDataToByteBuffer(List<DomainControllerData> data) throws Exception {
        final ByteArrayOutputStream out_stream = new ByteArrayOutputStream(512);
        byte[] result;
        try (DataOutputStream out = new DataOutputStream(out_stream)) {
            Iterator<DomainControllerData> iter = data.iterator();
            while (iter.hasNext()) {
                DomainControllerData dcData = iter.next();
                dcData.writeTo(out);
                if (iter.hasNext()) {
                    S3Util.writeString(SEPARATOR, out);
                }
            }
            result = out_stream.toByteArray();
        }
        return result;
    }
public static byte [ ] domainControllerDataToByteBuffer ( List < DomainControllerData > data ) throws Exception { final ByteArrayOutputStream out_stream = new ByteArrayOutputStream ( 512 ) ; byte [ ] result ; try ( DataOutputStream out = new DataOutputStream ( out_stream ) ) { Iterator < DomainControllerData > iter = data . iterator ( ) ; while ( iter . hasNext ( ) ) { DomainControllerData dcData = iter . next ( ) ; dcData . writeTo ( out ) ; if ( iter . hasNext ( ) ) { S3Util . writeString ( SEPARATOR , out ) ; } } result = out_stream . toByteArray ( ) ; } return result ; }
Write the domain controller data to a byte buffer.

@param data the domain controller data
@return the byte buffer
@throws Exception