on 06-22-2006 2:11 PM
Hi All
I need to convert an XML file which is stored in ASCII format into a file in Byte Sequence format. Does anybody have an idea of how to progress.
Thanks in advance
Sree Ramya
If you mean conversion of XML content of a file into byte array then here is the code.
BufferedReader bReader = new BufferedReader(new FileReader(filePath));
StringBuffer sBuf = new StringBuffer();
char[] chrArr= new char[1024];
int count= 0;
while( (count= reader.read(chars)) > -1){
sBuf.append(String.valueOf(chrArr));
}
byte[] byteArrData = sBuf.toString().getBytes("UTF-8");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.