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