1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

native code: synchronization with C++ version

This commit is contained in:
Nikolay Pultsin 2012-11-13 01:49:26 +04:00
parent 6fd4e1e98f
commit d93770c0f8
111 changed files with 804 additions and 697 deletions

View file

@ -44,7 +44,7 @@ bool FormatPlugin::detectEncodingAndLanguage(Book &book, ZLInputStream &stream,
if (collection.isLanguageAutoDetectEnabled() && stream.open()) {
static const int BUFSIZE = 65536;
char *buffer = new char[BUFSIZE];
const size_t size = stream.read(buffer, BUFSIZE);
const std::size_t size = stream.read(buffer, BUFSIZE);
stream.close();
shared_ptr<ZLLanguageDetector::LanguageInfo> info = ZLLanguageDetector().findInfo(buffer, size);
delete[] buffer;
@ -77,7 +77,7 @@ bool FormatPlugin::detectLanguage(Book &book, ZLInputStream &stream, const std::
if (collection.isLanguageAutoDetectEnabled() && stream.open()) {
static const int BUFSIZE = 65536;
char *buffer = new char[BUFSIZE];
const size_t size = stream.read(buffer, BUFSIZE);
const std::size_t size = stream.read(buffer, BUFSIZE);
stream.close();
shared_ptr<ZLLanguageDetector::LanguageInfo> info =
ZLLanguageDetector().findInfoForEncoding(encoding, buffer, size, -20000);