Get the contents of an InputStream as a list of Strings, one entry per line, using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from, not null @return the list of Strings, never null @throws NullPointerException if the input is null @throws IOException if an I/O error occurs @since 1.1
Reads all of the lines from a {@link Readable object. The lines do not include line-termination characters, but do include other leading and trailing whitespace. Does not close the Readable. If reading files or resources you should use the {@link Files#readLines and {@link Resources#readLinesmethods. @param r the object to read from @return a mutable {@link List containing all the lines @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/gen/net/stencilproject/gen/GenerateCompareOps.java
< for (String line : (List<String>) IOUtils.readLines(in)) { --- > for (String line : CharStreams.readLines(new InputStreamReader(in, Charsets.UTF_8))) {
Reads the contents of a file into a String. The file is always closed. @param filethe file to read, must not be null @param encodingthe encoding to use, null means platform default @return the file contents, never null @throws IOExceptionin case of an I/O error @throws UnsupportedCharsetExceptionthrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not supported. @since 2.3
Reads all characters from a file into a {@link String, using the given character set. @param file the file to read from @param charset the charset used to decode the input stream; see {@link Charsets for helpful predefined constants @return a string containing all the characters from the file @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/carrot2/carrot2 - From c72ead98d86bf9ce8c2b06048518fb8934a879ea - To da390159d9c05758768ffae7fe795602e85cf361 File applications/carrot2-dcs/src-test/org/carrot2/dcs/DcsAppTest.java
Copy chars from a Reader to bytes on an OutputStream using the specified character encoding, and calling flush. This method buffers the input internally, so there is no need to use a BufferedReader. Character encoding names can be found at IANA. Due to the implementation of OutputStreamWriter, this method performs a flush. This method uses OutputStreamWriter. @param input the Reader to read from @param output the OutputStream to write to @param encoding the encoding to use, null means platform default @throws NullPointerException if the input or output is null @throws IOException if an I/O error occurs @throws UnsupportedCharsetExceptionthrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not supported. @since 1.1
Copies all characters between the {@link Readable and {@link Appendableobjects. Does not close or flush either object. @param from the object to read from @param to the object to write to @return the number of characters copied @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/dcs3apj/process-support - From c1628f55d80cfa45121db4484027cbfc16c5813e - To b333f83415c1e1aee266cbd0c4ad612e21adc052 File src/main/java/uk/co/unclealex/process/builder/BuildingProcessRequest.java
< CharStreams.copy(reader, new OutputStreamWriter(standardInputOutputStream, charset)); --- > IOUtils.copy(reader, standardInputOutputStream, charset);
Repo https://github.com/dcs3apj/process-support - From c1628f55d80cfa45121db4484027cbfc16c5813e - To b333f83415c1e1aee266cbd0c4ad612e21adc052 File src/main/java/uk/co/unclealex/process/builder/BuildingProcessRequest.java
< CharStreams.copy(reader, new OutputStreamWriter(standardInputOutputStream, Charset.defaultCharset())); --- > IOUtils.copy(reader, standardInputOutputStream, Charset.defaultCharset().name());
Computes the checksum of a file using the CRC32 checksum routine. The value of the checksum is returned. @param file the file to checksum, must not be null @return the checksum value @throws NullPointerException if the file or checksum is null @throws IllegalArgumentException if the file is a directory @throws IOException if an IO error occurs reading the file @since 1.3
Computes and returns the checksum value for a file. The checksum object is reset when this method returns successfully. @param file the file to read @param checksum the checksum object @return the result of {@link Checksum#getValue after updating the checksum object with all of the bytes in the file @throws IOException if an I/O error occurs @deprecated Use hash with the Hashing.crc32() or Hashing.adler32() hash functions. This method is scheduled to be removed in Guava 15.0.
Source code examples
Repo https://github.com/syphr42/libmythtv-java - From 35d93399c659bf7f99edc40910705aa00da60bf9 - To 8aa38265199e26bac10a80f99b63bde4eeb06873 File src/test/java/org/syphr/mythtv/proto/QueryFileTransferTest.java
Get the contents of an InputStream as a byte[]. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from @return the requested byte array @throws NullPointerException if the input is null @throws IOException if an I/O error occurs
Returns the data from a {@link InputStream factory as a byte array. @param supplier the factory @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/dangerfield/java-webcam-server - From ca26d5cc68bce113d39b7d5e35efc16826c5274e - To fb5b5361b02f8cb87e33a338909e1c5260ee3f66 File webcams-captureloop/src/main/java/uk/ac/warwick/radio/media/webcams/local/types/IPCamera.java
Get the contents of a Reader as a String. This method buffers the input internally, so there is no need to use a BufferedReader. @param input the Reader to read from @return the requested String @throws NullPointerException if the input is null @throws IOException if an I/O error occurs
Reads all characters from a {@link Readable object into a {@link String. Does not close the Readable. @param r the object to read from @return a string containing all the characters @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/src/net/stencilproject/template/TemplateFile.java
Unconditionally close an Reader. Equivalent to Reader#close(), except any exceptions will be ignored. This is typically used in finally blocks. Example code:
char[] data = new char[1024]; Reader in = null; try { in = new FileReader("foo.txt"); in.read(data); in.close(); //close errors are handled catch (Exception e) { // error handling finally { IOUtils.closeQuietly(in);
@param input the Reader to close, may be null or already closed
Equivalent to calling close(closeable, true), but with no IOException in the signature. @param closeable the Closeable object to be closed, or null, in which case this method does nothing @deprecated Where possible, use the try-with-resources statement if using JDK7 or {@link Closer on JDK6 to close one or more Closeable objects. This method is deprecated because it is easy to misuse and may swallow IO exceptions that really should be thrown and handled. See Guava issue 1118 for a more detailed explanation of the reasons for deprecation and see Closing Resources for more information on the problems with closing Closeableobjects and some of the preferred solutions for handling it correctly. This method is scheduled to be removed in Guava 16.0.
Source code examples
Repo https://github.com/xebialabs/overthere - From 9f28b2d180ba3ff07693709ef7f04d53798b0b98 - To 0642979518804b4c2c23d219aa15485ef9bf0dd6 File src/main/java/com/xebialabs/overthere/OverthereConnection.java
Repo https://github.com/xebialabs/overthere - From 9f28b2d180ba3ff07693709ef7f04d53798b0b98 - To 0642979518804b4c2c23d219aa15485ef9bf0dd6 File src/main/java/com/xebialabs/overthere/OverthereConnection.java
Repo https://github.com/tomcz/pico-webapp - From 8dbf8807da9038f81820c06c19f53a4f2c8dd8fb - To fe2a83571beb41865747c1aadb3cd94e4d85c7c0 File src/main/example/framework/servlet/ServletRequestContext.java
Get the contents of an InputStream as a String using the specified character encoding. Character encoding names can be found at IANA. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from @param encoding the encoding to use, null means platform default @return the requested String @throws NullPointerException if the input is null @throws IOException if an I/O error occurs @throws UnsupportedCharsetExceptionthrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not supported.
Reads all characters from a {@link Readable object into a {@link String. Does not close the Readable. @param r the object to read from @return a string containing all the characters @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/tomcz/pico-webapp - From 8dbf8807da9038f81820c06c19f53a4f2c8dd8fb - To fe2a83571beb41865747c1aadb3cd94e4d85c7c0 File src/main/example/framework/servlet/ServletRequestContext.java
Writes a String to a file creating the file if it does not exist using the default encoding for the VM. @param file the file to write @param data the content to write to the file @throws IOException in case of an I/O error
Writes a character sequence (such as a string) to a file using the given character set. @param from the character sequence to write @param to the destination file @param charset the charset used to encode the output stream; see {@link Charsets for helpful predefined constants @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/aaronp/fsm - From 9f798e7dc8f33c9baf73212e64f248039425c428 - To 9564d04ef797a28278b8ce834408b948760abcc6 File src/main/java/com/porpoise/fsm/generator/FileWriters.java
< private static class Echo implements IFileWriter < { < private final PrintStream out; < < public Echo(final PrintStream outStream) < { < this.out = outStream; < } < < @Override < public void write(final String subDirectory, final String fileName, final String content) throws FileGenerationException < { < this.out.println("======================================="); < this.out.println(subDirectory); < this.out.println(" => "); < this.out.println(fileName); < this.out.println("======================================="); < this.out.println(content); < this.out.println(); < this.out.println(); < < } < } < < private static class Local implements IFileWriter < { < < private final File dir; < private boolean overwrite = true; < < public boolean isOverwrite() < { < return this.overwrite; < } < < void setOverwrite(final boolean overwrite) < { < this.overwrite = overwrite; < } < < public Local(final File dir) < { < this.dir = dir; < if (!dir.isDirectory()) < { < boolean success = true; < if (!dir.exists()) < { < success = dir.mkdirs(); < } < if (!success) < { < throw new IllegalArgumentException(String.format("%s is not a directory", dir)); < } < } < } < < @Override < public void write(final String subDir, final String fileName, final String content) throws FileGenerationException < { < final File packageDir = new File(this.dir, subDir); < if (!packageDir.exists()) < { < final boolean success = packageDir.mkdirs(); < if (!success) < { < throw new IllegalStateException(String.format("Trying to create directory '%s' was unsuccessful", packageDir.getName())); < } < } < < final File file = new File(packageDir, formatFileName(fileName)); < if (file.exists()) < { < if (!isOverwrite()) < { < return; < } < } < try < { < FileUtils.writeStringToFile(file, content); < } < catch (final IOException e) < { < throw new FileGenerationException(file, e); < } < } < < private String formatFileName(final String fileName) < { < return String.format("%s.java", fileName); < } < < } < < /** < * @param dir < * @return < */ < public static IFileWriter localGenerator(final File dir) < { < final Local local = new Local(dir); < local.setOverwrite(true); < return local; < } < < /** < * @param dir < * @return < */ < public static IFileWriter echoGenerator() < { < return echoGenerator(System.out); < } < < public static IFileWriter echoGenerator(final PrintStream out) < { < return new Echo(out); < } --- > private static class Echo implements IFileWriter > { > private final PrintStream out; > > public Echo(final PrintStream outStream) > { > this.out = outStream; > } > > @Override > public void write(final String subDirectory, final String fileName, final String content) > throws FileGenerationException > { > this.out.println("======================================="); > this.out.println(subDirectory); > this.out.println(" => "); > this.out.println(fileName); > this.out.println("======================================="); > this.out.println(content); > this.out.println(); > this.out.println(); > > } > } > > private static class Local implements IFileWriter > { > > private final File dir; > private boolean overwrite = true; > > public boolean isOverwrite() > { > return this.overwrite; > } > > void setOverwrite(final boolean overwrite) > { > this.overwrite = overwrite; > } > > public Local(final File dir) > { > this.dir = dir; > if (!dir.isDirectory()) > { > boolean success = true; > if (!dir.exists()) > { > success = dir.mkdirs(); > } > if (!success) > { > throw new IllegalArgumentException(String.format("%s is not a directory", dir)); > } > } > } > > @Override > public void write(final String subDir, final String fileName, final String content) > throws FileGenerationException > { > final File packageDir = new File(this.dir, subDir); > if (!packageDir.exists()) > { > final boolean success = packageDir.mkdirs(); > if (!success) > { > throw new IllegalStateException(String.format("Trying to create directory '%s' was unsuccessful", > packageDir.getName())); > } > } > > final File file = new File(packageDir, formatFileName(fileName)); > if (file.exists()) > { > if (!isOverwrite()) > { > return; > } > } > try > { > Files.write(content, file, Charsets.UTF_8); > } > catch (final IOException e) > { > throw new FileGenerationException(file, e); > } > } > > private String formatFileName(final String fileName) > { > return String.format("%s.java", fileName); > } > > } > > /** > * @param dir > * @return > */ > public static IFileWriter localGenerator(final File dir) > { > final Local local = new Local(dir); > local.setOverwrite(true); > return local; > } > > /** > * @param dir > * @return > */ > public static IFileWriter echoGenerator() > { > return echoGenerator(System.out); > } > > public static IFileWriter echoGenerator(final PrintStream out) > { > return new Echo(out); > }
Makes a directory, including any necessary but nonexistent parent directories. If a file already exists with specified name but it is not a directory then an IOException is thrown. If the directory cannot be created (or does not already exist) then an IOException is thrown. @param directory directory to create, must not be null @throws NullPointerException if the directory is null @throws IOException if the directory cannot be created or the file already exists but is not a directory
Creates any necessary but nonexistent parent directories of the specified file. Note that if this operation fails it may have succeeded in creating some (but not all) of the necessary parent directories. @throws IOException if an I/O error occurs, or if any necessary but nonexistent parent directories of the specified file could not be created. @since 4.0
Source code examples
Repo https://github.com/jenkinsci/timestamper-plugin - From 8a5633d8753ba0707f7955552f0f59fc34f24ffa - To e81fc789ae05a4afaf6fb0c10fa925553c81ca9c File src/main/java/hudson/plugins/timestamper/TimestampsIO.java
Copy bytes from an InputStream to an OutputStream. This method buffers the input internally, so there is no need to use a BufferedInputStream. Large streams (over 2GB) will return a bytes copied value of -1 after the copy has completed since the correct number of bytes cannot be returned as an int. For large streams use the copyLarge(InputStream, OutputStream) method. @param input the InputStream to read from @param output the OutputStream to write to @return the number of bytes copied, or -1 if > Integer.MAX_VALUE @throws NullPointerException if the input or output is null @throws IOException if an I/O error occurs @since 1.1
Copies all bytes from the input stream to the output stream. Does not close or flush either stream. @param from the input stream to read from @param to the output stream to write to @return the number of bytes copied @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/dcs3apj/process-support - From 1d2be1fa7d9caaf38764d7a3a32b90825b5cbdfb - To 66b7094c7e04b9c13a64991052b722a287c08311 File src/main/java/uk/co/unclealex/process/ProcessServiceImpl.java
Repo https://github.com/dcs3apj/process-support - From c1628f55d80cfa45121db4484027cbfc16c5813e - To b333f83415c1e1aee266cbd0c4ad612e21adc052 File src/main/java/uk/co/unclealex/process/builder/BuildingProcessRequest.java
Get the contents of an InputStream as a list of Strings, one entry per line, using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from, not null @return the list of Strings, never null @throws NullPointerException if the input is null @throws IOException if an I/O error occurs @since 1.1
Reads all of the lines from a URL. The lines do not include line-termination characters, but do include other leading and trailing whitespace. @param url the URL to read from @param charset the charset used to decode the input stream; see {@link Charsets for helpful predefined constants @return a mutable {@link List containing all the lines @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/src/net/stencilproject/template/BaseParser.java
Unconditionally close an InputStream. Equivalent to InputStream#close(), except any exceptions will be ignored. This is typically used in finally blocks. Example code:
byte[] data = new byte[1024]; InputStream in = null; try { in = new FileInputStream("foo.txt"); in.read(data); in.close(); //close errors are handled catch (Exception e) { // error handling finally { IOUtils.closeQuietly(in);
@param input the InputStream to close, may be null or already closed
Equivalent to calling close(closeable, true), but with no IOException in the signature. @param closeable the Closeable object to be closed, or null, in which case this method does nothing @deprecated Where possible, use the try-with-resources statement if using JDK7 or {@link Closer on JDK6 to close one or more Closeable objects. This method is deprecated because it is easy to misuse and may swallow IO exceptions that really should be thrown and handled. See Guava issue 1118 for a more detailed explanation of the reasons for deprecation and see Closing Resources for more information on the problems with closing Closeableobjects and some of the preferred solutions for handling it correctly. This method is scheduled to be removed in Guava 16.0.
Source code examples
Repo https://github.com/dcs3apj/process-support - From 1d2be1fa7d9caaf38764d7a3a32b90825b5cbdfb - To 66b7094c7e04b9c13a64991052b722a287c08311 File src/main/java/uk/co/unclealex/process/ProcessServiceImpl.java
Repo https://github.com/jenkinsci/timestamper-plugin - From 8a5633d8753ba0707f7955552f0f59fc34f24ffa - To e81fc789ae05a4afaf6fb0c10fa925553c81ca9c File src/main/java/hudson/plugins/timestamper/TimestampsIO.java
Repo https://github.com/jenkinsci/timestamper-plugin - From 8a5633d8753ba0707f7955552f0f59fc34f24ffa - To e81fc789ae05a4afaf6fb0c10fa925553c81ca9c File src/main/java/hudson/plugins/timestamper/TimestampsIO.java
Repo https://github.com/jenkinsci/timestamper-plugin - From 8a5633d8753ba0707f7955552f0f59fc34f24ffa - To e81fc789ae05a4afaf6fb0c10fa925553c81ca9c File src/main/java/hudson/plugins/timestamper/action/TimestampsAction.java
Unconditionally close an OutputStream. Equivalent to OutputStream#close(), except any exceptions will be ignored. This is typically used in finally blocks. Example code:
byte[] data = "Hello, World".getBytes(); OutputStream out = null; try { out = new FileOutputStream("foo.txt"); out.write(data); out.close(); //close errors are handled catch (IOException e) { // error handling finally { IOUtils.closeQuietly(out);
@param output the OutputStream to close, may be null or already closed
Equivalent to calling close(closeable, true), but with no IOException in the signature. @param closeable the Closeable object to be closed, or null, in which case this method does nothing @deprecated Where possible, use the try-with-resources statement if using JDK7 or {@link Closer on JDK6 to close one or more Closeable objects. This method is deprecated because it is easy to misuse and may swallow IO exceptions that really should be thrown and handled. See Guava issue 1118 for a more detailed explanation of the reasons for deprecation and see Closing Resources for more information on the problems with closing Closeableobjects and some of the preferred solutions for handling it correctly. This method is scheduled to be removed in Guava 16.0.
Source code examples
Repo https://github.com/dcs3apj/process-support - From 1d2be1fa7d9caaf38764d7a3a32b90825b5cbdfb - To 66b7094c7e04b9c13a64991052b722a287c08311 File src/main/java/uk/co/unclealex/process/ProcessServiceImpl.java
Repo https://github.com/jenkinsci/timestamper-plugin - From 8a5633d8753ba0707f7955552f0f59fc34f24ffa - To e81fc789ae05a4afaf6fb0c10fa925553c81ca9c File src/main/java/hudson/plugins/timestamper/TimestampsIO.java
Get the contents of an InputStream as a String using the specified character encoding. Character encoding names can be found at IANA. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from @param encoding the encoding to use, null means platform default @return the requested String @throws NullPointerException if the input is null @throws IOException if an I/O error occurs @throws UnsupportedCharsetExceptionthrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not supported.
Reads all characters from a URL into a {@link String, using the given character set. @param url the URL to read from @param charset the charset used to decode the input stream; see {@link Charsets for helpful predefined constants @return a string containing all the characters from the URL @throws IOException if an I/O error occurs.
Source code examples
Repo https://github.com/mysema/codegen - From 6d49f9b3b665f4ceaa67076f572c210af6b985f1 - To 1b777cdaa71f93cd2da5419bd09e25a4e379d240 File src/test/java/com/mysema/codegen/JavaWriterTest.java
Repo https://github.com/mysema/codegen - From 6d49f9b3b665f4ceaa67076f572c210af6b985f1 - To 1b777cdaa71f93cd2da5419bd09e25a4e379d240 File src/test/java/com/mysema/codegen/JavaWriterTest.java
Get the contents of an InputStream as a String using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from @return the requested String @throws NullPointerException if the input is null @throws IOException if an I/O error occurs
Reads all characters from a URL into a {@link String, using the given character set. @param url the URL to read from @param charset the charset used to decode the input stream; see {@link Charsets for helpful predefined constants @return a string containing all the characters from the URL @throws IOException if an I/O error occurs.
Source code examples
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/test/net/stencilproject/template/full/FullTemplateTest.java
Copy bytes from an InputStream to chars on a Writer using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a BufferedInputStream. This method uses InputStreamReader. @param input the InputStream to read from @param output the Writer to write to @throws NullPointerException if the input or output is null @throws IOException if an I/O error occurs @since 1.1
Copies all characters between the {@link Readable and {@link Appendableobjects. Does not close or flush either object. @param from the object to read from @param to the object to write to @return the number of characters copied @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/dcs3apj/process-support - From 1d2be1fa7d9caaf38764d7a3a32b90825b5cbdfb - To 66b7094c7e04b9c13a64991052b722a287c08311 File src/main/java/uk/co/unclealex/process/ProcessServiceImpl.java
Copy bytes from an InputStream to an OutputStream. This method buffers the input internally, so there is no need to use a BufferedInputStream. Large streams (over 2GB) will return a bytes copied value of -1 after the copy has completed since the correct number of bytes cannot be returned as an int. For large streams use the copyLarge(InputStream, OutputStream) method. @param input the InputStream to read from @param output the OutputStream to write to @return the number of bytes copied, or -1 if > Integer.MAX_VALUE @throws NullPointerException if the input or output is null @throws IOException if an I/O error occurs @since 1.1
Copies all bytes from a URL to an output stream. @param from the URL to read from @param to the output stream @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/syphr42/libmythtv-java - From 35d93399c659bf7f99edc40910705aa00da60bf9 - To 8aa38265199e26bac10a80f99b63bde4eeb06873 File src/test/java/org/syphr/mythtv/proto/QueryFileTransferTest.java
Reads the contents of a file into a String. The file is always closed. @param filethe file to read, must not be null @param encodingthe encoding to use, null means platform default @return the file contents, never null @throws IOExceptionin case of an I/O error @throws UnsupportedCharsetExceptionthrown instead of UnsupportedEncodingException in version 2.2 if the encoding is not supported. @since 2.3
Reads all bytes from a file into a byte array. @param file the file to read from @return a byte array containing all the bytes from file @throws IllegalArgumentException if the file is bigger than the largest possible byte array (2^31 - 1) @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/carrot2/carrot2 - From c72ead98d86bf9ce8c2b06048518fb8934a879ea - To da390159d9c05758768ffae7fe795602e85cf361 File applications/carrot2-dcs/src-test/org/carrot2/dcs/DcsAppTest.java
< FileUtils.readFileToString(testFiles.get(inputDataKey), "UTF-8")); --- > new ByteArrayBody(Files.toByteArray(testFiles.get(inputDataKey)), "testfile.xml"));
Copy chars from a Reader to bytes on an OutputStream using the default character encoding of the platform, and calling flush. This method buffers the input internally, so there is no need to use a BufferedReader. Due to the implementation of OutputStreamWriter, this method performs a flush. This method uses OutputStreamWriter. @param input the Reader to read from @param output the OutputStream to write to @throws NullPointerException if the input or output is null @throws IOException if an I/O error occurs @since 1.1
Copies all characters between the {@link Readable and {@link Appendableobjects. Does not close or flush either object. @param from the object to read from @param to the object to write to @return the number of characters copied @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/dcs3apj/process-support - From 1d2be1fa7d9caaf38764d7a3a32b90825b5cbdfb - To 66b7094c7e04b9c13a64991052b722a287c08311 File src/main/java/uk/co/unclealex/process/ProcessServiceImpl.java
< IOUtils.copy(reader, stdin); --- > CharStreams.copy(reader, new OutputStreamWriter(stdin));
Get the contents of an InputStream as a String using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a BufferedInputStream. @param input the InputStream to read from @return the requested String @throws NullPointerException if the input is null @throws IOException if an I/O error occurs
Reads all characters from a {@link Readable object into a {@link String. Does not close the Readable. @param r the object to read from @return a string containing all the characters @throws IOException if an I/O error occurs
Source code examples
Repo https://github.com/awired/ajsl - From 7805d6a29c3aa0a45b42210cd6677a1ad7033763 - To f77d8c861fbf030a57ab2e58701c9553663c557f File web/src/main/java/net/awired/ajsl/web/IndexTemplateServlet.java
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/src/net/stencilproject/template/TemplateFile.java
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/src/net/stencilproject/template/TemplateFile.java
Repo https://github.com/mmastrac/Stencil - From 52f7b1609e0a6c2a1137ba641737d9712e9abc45 - To 2a92d0fa8991de89c8ddf1ff1217bad36f7e251f File stencil/src/net/stencilproject/template/TemplateFile.java