parent
eb5fd9bab2
commit
c3528a3548
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,35 @@
|
||||
package menu;
|
||||
import sun.misc.BASE64Encoder;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
|
||||
public class FileType {
|
||||
public static String change_sound_io(File media){
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
try{
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
byte[] bytes = byteArrayOutputStream.toByteArray();
|
||||
FileInputStream in = new FileInputStream(media);
|
||||
in.read(bytes);
|
||||
in.close();
|
||||
return encoder.encodeBuffer(bytes).trim();
|
||||
}catch(IOException e1){
|
||||
e1.printStackTrace();
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
public static void input_File(String str) {
|
||||
File file = new File(MainWindow.ReturnFile + MainWindow.Filename);
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file, true);
|
||||
try {
|
||||
fileOutputStream.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
} catch (FileNotFoundException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue