/** * Append binary data to the file. See {@link #append(Path, java.io.InputStream)} * * @param path a Path * @param data an InputStream of data to write to the file * @return the file * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static Path leftShift(Path path, InputStream data) throws IOException { append(path, data); return path; }
/** * Write the text to the Path. * * @param self a Path * @param text the text to write to the Path * @return the original file * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static Path leftShift(Path self, Object text) throws IOException { append(self, text); return self; }
/** * Append the text at the end of the Path without writing a BOM, using a specified * encoding. * * @param self a Path * @param text the text to append at the end of the Path * @param charset the charset used * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static void append(Path self, Object text, String charset) throws IOException { append(self, text, charset, false); }
/** * Append the text supplied by the Reader at the end of the File without writing * a BOM, using a specified encoding. * * @param file a File * @param reader the Reader supplying the text to append at the end of the File * @param charset the charset used * @throws IOException if an IOException occurs. * @since 2.3.0 */ public static void append(Path file, Reader reader, String charset) throws IOException { append(file, reader, charset, false); }
/** * Write bytes to a Path. * * @param self a Path * @param bytes the byte array to append to the end of the Path * @return the original file * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static Path leftShift(Path self, byte[] bytes) throws IOException { append(self, bytes); return self; }
/** * Append binary data to the file. See {@link #append(Path, java.io.InputStream)} * * @param path a Path * @param data an InputStream of data to write to the file * @return the file * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static Path leftShift(Path path, InputStream data) throws IOException { append(path, data); return path; }
/** * Append the text at the end of the Path without writing a BOM. * * @param self a Path * @param text the text to append at the end of the Path * @throws java.io.IOException if an IOException occurs. * @since 2.3.0 */ public static void append(Path self, Object text) throws IOException { append(self, text, Charset.defaultCharset().name(), false); }
/** * Append the text supplied by the Writer at the end of the File without writing a BOM. * * @param file a File * @param writer the Writer supplying the text to append at the end of the File * @throws IOException if an IOException occurs. * @since 2.3.0 */ public static void append(Path file, Writer writer) throws IOException { append(file, writer, Charset.defaultCharset().name()); }
/** * Append the text supplied by the Writer at the end of the File without * writing a BOM. * * @param file a Path * @param reader the Reader supplying the text to append at the end of the File * @throws IOException if an IOException occurs. * @since 2.3.0 */ public static void append(Path file, Reader reader) throws IOException { append(file, reader, Charset.defaultCharset().name()); }
/** * Append the text at the end of the Path. If the default charset is * "UTF-16BE" or "UTF-16LE" (or an equivalent alias) and * <code>writeBom</code> is <code>true</code>, the requisite byte order * mark is written to the file before the text. * * @param self a Path * @param text the text to append at the end of the Path * @param writeBom whether to write the BOM * @throws java.io.IOException if an IOException occurs. * @since 2.5.0 */ public static void append(Path self, Object text, boolean writeBom) throws IOException { append(self, text, Charset.defaultCharset().name(), writeBom); }
/** * Append the text supplied by the Writer at the end of the File, using a specified encoding. * If the given charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), * <code>writeBom</code> is <code>true</code>, and the file doesn't already * exist, the requisite byte order mark is written to the file before the * text is appended. * * @param file a File * @param writer the Writer supplying the text to append at the end of the File * @param writeBom whether to write the BOM * @throws IOException if an IOException occurs. * @since 2.5.0 */ public static void append(Path file, Writer writer, boolean writeBom) throws IOException { append(file, writer, Charset.defaultCharset().name(), writeBom); }