Project

General

Profile

« Previous | Next » 

Revision 1763

Added by Jing Tao over 20 years ago

Using reader to replace string to read inline data.

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
1014 1014
          // for inline data, the data base only store the file name, so we
1015 1015
          // can combine the file name and inline data file path, to get it
1016 1016
          String fileName = currentNode.nodedata;
1017
          String content = EmlSAXHandler.readInlineDataFromFileSystem(fileName);
1018
          out.print(content);
1017
          Reader reader = 
1018
                          EmlSAXHandler.readInlineDataFromFileSystem(fileName);
1019
          char [] characterArray = new char [4*10];
1020
          try
1021
          {
1022
            int length = reader.read(characterArray);
1023
            while ( length != -1)
1024
            {
1025
              out.print(new String(characterArray, 0, length));
1026
              out.flush();
1027
              length = reader.read(characterArray);
1028
            }
1029
            reader.close();
1030
          }
1031
          catch (IOException e)
1032
          {
1033
            throw new McdbException(e.getMessage());
1034
          }
1019 1035
        }
1036
        
1020 1037
        // reset proccess inline data false
1021 1038
        prcocessInlineData =false;
1022 1039
        previousNodeWasElement = false;

Also available in: Unified diff