currentFilePart = new FilePart(totalBlockCount, lastBlockLength, null);
// --- check & prepare encoding ---
Charset charset = Charsets.toCharset(encoding);
CharsetEncoder charsetEncoder = charset.newEncoder();
float maxBytesPerChar = charsetEncoder.maxBytesPerChar();
if(maxBytesPerChar==1f) {
// all one byte encodings are no problem
byteDecrement = 1;
} else if(charset == Charset.forName("UTF-8")) {
// UTF-8 works fine out of the box, for multibyte sequences a second UTF-8 byte can never be a newline byte