• Post Reply Bookmark Topic Watch Topic
  • New Topic

OutputStreamWriter

 
Manuel Paco
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help please.
I can't get this working.
String password = "cassiopea";

Cipher c =
Cipher.getInstance ("DES/CFB8/NoPadding");
c.init(Cipher.ENCRYPT_MODE, key);
CipherOutputStream cos =
new CipherOutputStream
( new FileOutputStream("CipherFile"), c );

I can't get this working
OutputStreamWriter osw =
new OutputStreamWriter(cos);
osw.write( password, 0, password.length() );

but this works fine
PrintWriter pw =
new PrintWriter( new OutputStreamWriter(cos) );
pw.println( password );
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!