import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

class attachmentGenerator {

    void generateAttachment(int size) throws IOException {
        byte[] attachment;

        byte[] bytes = new byte[(int) (size*0.75)];
        for(int i = 0; i < (size*0.75)-1; ++i) {
            bytes[i] = (byte)i;
        }

        attachment = bytes;

        try (Writer out = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream("src/main/resources/attachment.txt"), StandardCharsets.UTF_8))) {
            out.write(Base64.encode(attachment));
        }

    }

    void cleanUpAttachment() throws IOException {
        generateAttachment(0);
    }
}
