MCPcopy Create free account
hub / github.com/GateNLP/gate-core / run

Method run

src/main/java/gate/util/ObjectWriter.java:97–119  ·  view source on GitHub ↗

Writes all the buffers to the output stream

()

Source from the content-addressed store, hash-verified

95 /** Writes all the buffers to the output stream
96 */
97 @Override
98 public void run() {
99 try{
100 Iterator<byte[]> buffIter = buffer.iterator();
101 while(buffIter.hasNext()){
102 byte currentBuff[] = buffIter.next();
103 if(buffIter.hasNext()) {
104 // is not the last buffer
105 outputStream.write(currentBuff,0,buffSize);
106 } else {
107 // is the last buffer
108 // currentBuff[lastOffset] = '\u001a';
109 outputStream.write(currentBuff,0,lastOffset);
110 }
111 }// while(buffIter.hasNext())
112
113 outputStream.flush();
114 outputStream.close();
115 } catch(IOException ioe) {
116 throw new RuntimeException(ioe.toString());
117 // ioe.printStackTrace(Err.getPrintWriter());
118 }
119 }
120
121
122 /** I need a thread to write the object so I can read it in an buffer

Callers

nothing calls this directly

Calls 7

iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
closeMethod · 0.65
toStringMethod · 0.65
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected