List of utility methods to do FileOutputStream Write
void | WriteArrayOfStringPairs(FileOutputStream stream, ArrayList Write Array Of String Pairs WriteInt(stream, pairs.size());
for (Pair<String, String> pair : pairs) {
WriteString(stream, pair.getFirst());
WriteString(stream, pair.getSecond());
|
void | WriteInt(FileOutputStream stream, int value) Write Int stream.write(IntToBytes(value)); |
void | WriteString(FileOutputStream stream, String text) Write String byte[] bytes = text.getBytes();
WriteInt(stream, bytes.length);
stream.write(bytes);
|
void | saveFileContent(String file, String content, String encode) save File Content OutputStream os = null; try { os = new FileOutputStream(file); if (encode != null) { os.write(content.getBytes(encode)); } else { os.write(content.getBytes()); os.flush(); } catch (Exception e) { throw e; } finally { if (os != null) { os.close(); os = null; |
String | getXMLAsString(File xmlFile, String fileName) get XML As String try { File file = new File(xmlFile, fileName); InputStream inputStream = new FileInputStream(file.getPath()); StringBuffer outXml = new StringBuffer(); byte[] b = new byte[4096]; try { for (int n; (n = inputStream.read(b)) != -1;) { outXml.append(new String(b, 0, n)); ... |
void | Write(String fileName, String message) Write try { FileOutputStream outSTr = null; try { outSTr = new FileOutputStream(new File(fileName)); } catch (FileNotFoundException e) { e.printStackTrace(); BufferedOutputStream Buff = new BufferedOutputStream(outSTr); ... |