< prev index next >
jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -81,26 +81,32 @@
}
/**
* Set up the buffer name and permission mode.
* This method has any effect only if it is invoked before
- * you start writing into the output stream
+ * you start writing into the output stream.
+ *
+ * @param name name to set for the buffer.
+ * @param mode permission mode.
*/
public void setNameMode(String name, int mode) {
this.name = name;
this.mode = mode;
}
+ @Override
public void write(byte[] b, int off, int len) throws IOException {
for (int i = 0; i < len; i++)
write(b[off + i]);
}
+ @Override
public void write(byte[] data) throws IOException {
write(data, 0, data.length);
}
+ @Override
public void write(int c) throws IOException {
/* buffer up characters till we get a line's worth, then encode
* and write them out. Max number of characters allowed per
* line is 45.
*/
@@ -110,19 +116,21 @@
encode();
bufsize = 0;
}
}
+ @Override
public void flush() throws IOException {
if (bufsize > 0) { // If there's unencoded characters in the buffer
writePrefix();
encode(); // .. encode them
}
writeSuffix();
out.flush();
}
+ @Override
public void close() throws IOException {
flush();
out.close();
}
< prev index next >