PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9ccba56e8e
commit
c26255dcab
@ -196,19 +196,17 @@ public class WordDocument
|
|||||||
if(unicode)
|
if(unicode)
|
||||||
{
|
{
|
||||||
add = 2;
|
add = 2;
|
||||||
}
|
|
||||||
char ch;
|
char ch;
|
||||||
for(int y = start; y < end; y += add)
|
for(int y = start; y < end; y += add)
|
||||||
{
|
|
||||||
if(unicode)
|
|
||||||
{
|
{
|
||||||
ch = (char)Utils.convertBytesToShort(_header, y);
|
ch = (char)Utils.convertBytesToShort(_header, y);
|
||||||
|
out.write(ch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ch = (char)_header[y];
|
String sText = new String(_header, start, end-start);
|
||||||
}
|
out.write(sText);
|
||||||
out.write(ch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -221,10 +219,13 @@ public class WordDocument
|
|||||||
*/
|
*/
|
||||||
public WordDocument(String fileName) throws IOException
|
public WordDocument(String fileName) throws IOException
|
||||||
{
|
{
|
||||||
|
this(new FileInputStream(fileName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public WordDocument(InputStream inputStream) throws IOException
|
||||||
|
{
|
||||||
//do Ole stuff
|
//do Ole stuff
|
||||||
istream = new FileInputStream(fileName);
|
istream = inputStream;
|
||||||
filesystem = new POIFSFileSystem(istream);
|
filesystem = new POIFSFileSystem(istream);
|
||||||
|
|
||||||
//get important stuff from the Header block and parse all the
|
//get important stuff from the Header block and parse all the
|
||||||
|
Loading…
Reference in New Issue
Block a user