MCPcopy Create free account
hub / github.com/M66B/FairEmail / write

Method write

app/src/main/java/com/sun/mail/iap/Argument.java:237–267  ·  view source on GitHub ↗
(Protocol protocol)

Source from the content-addressed store, hash-verified

235 * Write out all the buffered items into the output stream.
236 */
237 public void write(Protocol protocol)
238 throws IOException, ProtocolException {
239 int size = items != null ? items.size() : 0;
240 DataOutputStream os = (DataOutputStream)protocol.getOutputStream();
241
242 for (int i=0; i < size; i++) {
243 if (i > 0) // write delimiter if not the first item
244 os.write(' ');
245
246 Object o = items.get(i);
247 if (o instanceof Atom) {
248 os.writeBytes(((Atom)o).string);
249 } else if (o instanceof Number) {
250 os.writeBytes(((Number)o).toString());
251 } else if (o instanceof AString) {
252 astring(((AString)o).bytes, protocol);
253 } else if (o instanceof NString) {
254 nstring(((NString)o).bytes, protocol);
255 } else if (o instanceof byte[]) {
256 literal((byte[])o, protocol);
257 } else if (o instanceof ByteArrayOutputStream) {
258 literal((ByteArrayOutputStream)o, protocol);
259 } else if (o instanceof Literal) {
260 literal((Literal)o, protocol);
261 } else if (o instanceof Argument) {
262 os.write('('); // open parans
263 ((Argument)o).write(protocol);
264 os.write(')'); // close parans
265 }
266 }
267 }
268
269 /**
270 * Write out given String as either an Atom, QuotedString or Literal

Callers 12

runMethod · 0.45
combineMethod · 0.45
getSignatureMethod · 0.45
getSignatureMethod · 0.45
nastringMethod · 0.45
literalMethod · 0.45
startLiteralMethod · 0.45
writeCommandMethod · 0.45
writeToMethod · 0.45
copyMethod · 0.45
WriteMethod · 0.45
stringpiece.ccFile · 0.45

Calls 8

astringMethod · 0.95
nstringMethod · 0.95
literalMethod · 0.95
writeBytesMethod · 0.80
sizeMethod · 0.65
getOutputStreamMethod · 0.65
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected