@Test public void testWriteStringOutputStream_sameCharset() throws Exception { String testString = "Testing©ÿ»"; ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); Streams.write(testString, outputStream, Charset.forName(UTF_8)); byte[] stringBytes = testString.getBytes(Charset.forName(UTF_8)); stringBytes = Arrays.copyOf(stringBytes, stringBytes.length); assertTrue( "Byte arrays shoud be equal", Arrays.equals(stringBytes, outputStream.toByteArray())); String actual = new String(outputStream.toByteArray(), Charset.forName(UTF_8)); assertEquals(testString, actual); }
@Deprecated public static void write(String str, final OutputStream outputStream) throws IOException { write(str, outputStream, Charset.defaultCharset()); }
Streams { @Deprecated public static void write(String str, final OutputStream outputStream) throws IOException { write(str, outputStream, Charset.defaultCharset()); } }
Streams { @Deprecated public static void write(String str, final OutputStream outputStream) throws IOException { write(str, outputStream, Charset.defaultCharset()); } private  Streams(); }
Streams { @Deprecated public static void write(String str, final OutputStream outputStream) throws IOException { write(str, outputStream, Charset.defaultCharset()); } private  Streams(); @Deprecated static InputStream wrapString(String str); static InputStream wrapString(String str, Charset charset); @Deprecated static String readAll(final InputStream inputStream); static String readAll(final InputStream inputStream, Charset charset); @Deprecated static void write(String str, final OutputStream outputStream); static void write(String str, final OutputStream outputStream, Charset charset); static void copy(final InputStream inputStream, final OutputStream outputStream); }
Streams { @Deprecated public static void write(String str, final OutputStream outputStream) throws IOException { write(str, outputStream, Charset.defaultCharset()); } private  Streams(); @Deprecated static InputStream wrapString(String str); static InputStream wrapString(String str, Charset charset); @Deprecated static String readAll(final InputStream inputStream); static String readAll(final InputStream inputStream, Charset charset); @Deprecated static void write(String str, final OutputStream outputStream); static void write(String str, final OutputStream outputStream, Charset charset); static void copy(final InputStream inputStream, final OutputStream outputStream);  }