Skip to content

Commit

Permalink
Chunking is not needed after all
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Nov 7, 2018
1 parent 0877b48 commit 4ed395c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const EventEmitter = require('events')
const flatstr = require('flatstr')
const inherits = require('util').inherits

const maxWriteSize = 4096

function openFile (file, sonic) {
sonic._writing = true
sonic.file = file
Expand Down Expand Up @@ -202,12 +200,7 @@ SonicBoom.prototype.destroy = function () {
function actualWrite (sonic) {
sonic._writing = true
var buf = sonic._buf
if (buf.length >= maxWriteSize) {
buf = sonic._buf.slice(0, maxWriteSize)
sonic._buf = sonic._buf.slice(maxWriteSize)
} else {
sonic._buf = ''
}
sonic._buf = ''
flatstr(buf)
sonic._writingBuf = buf
fs.write(sonic.fd, buf, 'utf8', sonic.release)
Expand Down

0 comments on commit 4ed395c

Please sign in to comment.