741 values = null; // for GC |
741 values = null; // for GC |
742 } |
742 } |
743 |
743 |
744 private void dumpBand() throws IOException { |
744 private void dumpBand() throws IOException { |
745 assert(optDumpBands); |
745 assert(optDumpBands); |
746 PrintStream ps = new PrintStream(getDumpStream(this, ".txt")); |
746 try (PrintStream ps = new PrintStream(getDumpStream(this, ".txt"))) { |
747 String irr = (bandCoding == regularCoding) ? "" : " irregular"; |
747 String irr = (bandCoding == regularCoding) ? "" : " irregular"; |
748 ps.print("# length="+length+ |
748 ps.print("# length="+length+ |
749 " size="+outputSize()+ |
749 " size="+outputSize()+ |
750 irr+" coding="+bandCoding); |
750 irr+" coding="+bandCoding); |
751 if (metaCoding != noMetaCoding) { |
751 if (metaCoding != noMetaCoding) { |
752 StringBuffer sb = new StringBuffer(); |
752 StringBuffer sb = new StringBuffer(); |
753 for (int i = 0; i < metaCoding.length; i++) { |
753 for (int i = 0; i < metaCoding.length; i++) { |
754 if (i == 1) sb.append(" /"); |
754 if (i == 1) sb.append(" /"); |
755 sb.append(" ").append(metaCoding[i] & 0xFF); |
755 sb.append(" ").append(metaCoding[i] & 0xFF); |
|
756 } |
|
757 ps.print(" //header: "+sb); |
756 } |
758 } |
757 ps.print(" //header: "+sb); |
759 printArrayTo(ps, values, 0, length); |
758 } |
760 } |
759 printArrayTo(ps, values, 0, length); |
761 try (OutputStream ds = getDumpStream(this, ".bnd")) { |
760 ps.close(); |
762 bandCoding.writeArrayTo(ds, values, 0, length); |
761 OutputStream ds = getDumpStream(this, ".bnd"); |
763 } |
762 bandCoding.writeArrayTo(ds, values, 0, length); |
|
763 ds.close(); |
|
764 } |
764 } |
765 |
765 |
766 /** Disburse one value. */ |
766 /** Disburse one value. */ |
767 protected int getValue() { |
767 protected int getValue() { |
768 assert(phase() == DISBURSE_PHASE); |
768 assert(phase() == DISBURSE_PHASE); |
827 destroy(); // done with the bits! |
827 destroy(); // done with the bits! |
828 } |
828 } |
829 |
829 |
830 private void dumpBand() throws IOException { |
830 private void dumpBand() throws IOException { |
831 assert(optDumpBands); |
831 assert(optDumpBands); |
832 OutputStream ds = getDumpStream(this, ".bnd"); |
832 try (OutputStream ds = getDumpStream(this, ".bnd")) { |
833 if (bytesForDump != null) |
833 if (bytesForDump != null) |
834 bytesForDump.writeTo(ds); |
834 bytesForDump.writeTo(ds); |
835 else |
835 else |
836 bytes.writeTo(ds); |
836 bytes.writeTo(ds); |
837 ds.close(); |
837 } |
838 } |
838 } |
839 |
839 |
840 public void readDataFrom(InputStream in) throws IOException { |
840 public void readDataFrom(InputStream in) throws IOException { |
841 int vex = valuesExpected(); |
841 int vex = valuesExpected(); |
842 if (vex == 0) return; |
842 if (vex == 0) return; |