by=bytestream.toByteArray();
String code = javax.xml.bind.DatatypeConverter.printBase64Binary(by);
File file = new File("C:\\Users\\00320558\\Desktop\\ko.jpg");
byte[] by = new byte[(int)file.length()];
InputStream is=new FileInputStream(file);
ByteArrayOutputStream bytestream =new ByteArrayOutputStream();
byte[] bb = new byte[2048];
int ch;
ch = is.read(bb);
while(ch != -1){
bytestream.write(bb,0,ch);
ch=is.read(bb);
}
by=bytestream.toByteArray();
String code = javax.xml.bind.DatatypeConverter.printBase64Binary(by);
System.out.println(code);