strm.close();
}
+ private void debug_write_bytes(String what, byte[] data) throws FileNotFoundException,IOException {
+ if (dtxt==null) return;
+ FileOutputStream strm = new FileOutputStream(new File("jarrg-debug-"+what));
+ strm.write(data);
+ strm.close();
+ }
+
private void progressNote(ProgressMonitor pm, String s) {
String arb = null;
if (arbitrageResult != null)
progressNote(pm, "Yarrg: Uploading");
progresslog("yarrg upload...");
- debug_write_stringdata("yarrg-deduped.tsv", yarrgdata);
-
doneyarrg = runYarrg(yarrgts, oceanName, islandName, yarrgdata);
progresslog("yarrg done.");
}
progresslog("pctb send...");
byte[] ba = outStream.toByteArray();
- if (dtxt!=null) {
- FileOutputStream dbgdata = new FileOutputStream(new File("jarrg-debug-pctb-marketdata.gz"));
- dbgdata.write(ba);
- dbgdata.close();
- }
+ debug_write_bytes("pctb-marketdata.gz", ba);
InputStream in = sendInitialData(new ByteArrayInputStream(ba));
progresslog("pctb sent.");
BufferedOutputStream bufos = new BufferedOutputStream(new GZIPOutputStream(bos));
bufos.write(yarrgdata.getBytes() );
bufos.close();
- ByteArrayInputStream file = new ByteArrayInputStream(bos.toByteArray());
+ byte[] compressed = bos.toByteArray();
+ debug_write_bytes("yarrg-deduped.tsv.gz", compressed);
+ ByteArrayInputStream file = new ByteArrayInputStream(compressed);
ClientHttpRequest http = new ClientHttpRequest (YARRG_URL);
http.setParameter("clientname", YARRG_CLIENTNAME);