Skip to content

Commit

Permalink
Override write(byte[] b, int off, int len) in FilterOutputStream for …
Browse files Browse the repository at this point in the history
…better performance

Closes #8748
  • Loading branch information
s1monw committed Dec 2, 2014
1 parent 943dbb8 commit d8f1617
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -89,6 +89,10 @@ public InputStream openInput(String name) throws IOException {
public OutputStream createOutput(String blobName) throws IOException {
final File file = new File(path, blobName);
return new BufferedOutputStream(new FilterOutputStream(new FileOutputStream(file)) {

@Override // FilterOutputStream#write(byte[] b, int off, int len) is trappy writes every single byte
public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len);}

@Override
public void close() throws IOException {
super.close();
Expand Down

0 comments on commit d8f1617

Please sign in to comment.