| | |
| | | private FileOutputStream fos = null; |
| | | private FileChannel fch = null; |
| | | private int logCount = 0; |
| | | private int elmCount = 0; |
| | | private int maxElmCount = 3000; |
| | | private boolean useElementCount = true; |
| | | private ArrayList<byte[]> dgnFileHeader = null; |
| | | private String elmOutPath; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | elmCount++; |
| | | if ((subBuffers.size() != 0) && (fch != null)) |
| | | { |
| | | for (ByteBuffer buf : subBuffers) |
| | |
| | | logger.warn("Create Dgn Logging File:" + logFile.toString()); |
| | | fos = new FileOutputStream(logFile); |
| | | fch = fos.getChannel(); |
| | | |
| | | prepareOutputElementStream(); |
| | | schemaChanged = false; |
| | | elmCount = 0; |
| | | } |
| | | |
| | | private void putEndOfFileElement() throws IOException |
| | |
| | | |
| | | public void flashLogging() |
| | | { |
| | | if ((useElementCount) && (elmCount < maxElmCount)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (fos != null) |
| | | { |
| | | try |
| | | { |
| | | putEndOfFileElement(); |
| | | fos.close(); |
| | | } catch (IOException e) |
| | | { |
| | |
| | | } |
| | | fos = null; |
| | | fch = null; |
| | | elmCount = 0; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return schemaChanged; |
| | | } |
| | | |
| | | public boolean isUseElementCount() |
| | | { |
| | | return useElementCount; |
| | | } |
| | | |
| | | public void setUseElementCount(boolean useElementCount) |
| | | { |
| | | this.useElementCount = useElementCount; |
| | | } |
| | | |
| | | public int getElmCount() |
| | | { |
| | | return elmCount; |
| | | } |
| | | |
| | | public int getMaxElmCount() |
| | | { |
| | | return maxElmCount; |
| | | } |
| | | |
| | | public void setMaxElmCount(int maxElmCount) |
| | | { |
| | | this.maxElmCount = maxElmCount; |
| | | } |
| | | } |