CCITTFaxFilter.java (pdfbox-2.0.23-src) | : | CCITTFaxFilter.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 140 | skipping to change at line 140 | |||
int pos = 0; | int pos = 0; | |||
int read; | int read; | |||
while ((read = decoderStream.read(result, pos, result.length - pos)) > - 1) | while ((read = decoderStream.read(result, pos, result.length - pos)) > - 1) | |||
{ | { | |||
pos += read; | pos += read; | |||
if (pos >= result.length) | if (pos >= result.length) | |||
{ | { | |||
break; | break; | |||
} | } | |||
} | } | |||
decoderStream.close(); | ||||
} | } | |||
private void invertBitmap(byte[] bufferData) | private void invertBitmap(byte[] bufferData) | |||
{ | { | |||
for (int i = 0, c = bufferData.length; i < c; i++) | for (int i = 0, c = bufferData.length; i < c; i++) | |||
{ | { | |||
bufferData[i] = (byte) (~bufferData[i] & 0xFF); | bufferData[i] = (byte) (~bufferData[i] & 0xFF); | |||
} | } | |||
} | } | |||
@Override | @Override | |||
protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters) | protected void encode(InputStream input, OutputStream encoded, COSDictionary parameters) | |||
throws IOException | throws IOException | |||
{ | { | |||
int cols = parameters.getInt(COSName.COLUMNS); | int cols = parameters.getInt(COSName.COLUMNS); | |||
int rows = parameters.getInt(COSName.ROWS); | int rows = parameters.getInt(COSName.ROWS); | |||
CCITTFaxEncoderStream ccittFaxEncoderStream = | CCITTFaxEncoderStream ccittFaxEncoderStream = | |||
new CCITTFaxEncoderStream(encoded, cols, rows, TIFFExtension.FIL L_LEFT_TO_RIGHT); | new CCITTFaxEncoderStream(encoded, cols, rows, TIFFExtension.FIL L_LEFT_TO_RIGHT); | |||
IOUtils.copy(input, ccittFaxEncoderStream); | IOUtils.copy(input, ccittFaxEncoderStream); | |||
input.close(); | ||||
} | } | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 0 lines changed or added |