/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
private void nastring(byte[] bytes, Protocol protocol, boolean doQuote) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); int len = bytes.length;
public void write(Protocol protocol) throws IOException, ProtocolException { int size = items != null ? items.size() : 0; DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); for (int i=0; i < size; i++) { if (i > 0) // write delimiter if not the first item os.write(' '); Object o = items.get(i); if (o instanceof Atom) { os.writeBytes(((Atom)o).string); } else if (o instanceof Number) { os.writeBytes(((Number)o).toString()); } else if (o instanceof AString) { astring(((AString)o).bytes, protocol); } else if (o instanceof NString) { nstring(((NString)o).bytes, protocol); } else if (o instanceof byte[]) { literal((byte[])o, protocol); } else if (o instanceof ByteArrayOutputStream) { literal((ByteArrayOutputStream)o, protocol); } else if (o instanceof Literal) { literal((Literal)o, protocol); } else if (o instanceof Argument) { os.write('('); // open parans ((Argument)o).write(protocol); os.write(')'); // close parans } } }
public void write(Protocol protocol) throws IOException, ProtocolException { int size = items != null ? items.size() : 0; DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); for (int i=0; i < size; i++) { if (i > 0) // write delimiter if not the first item os.write(' '); Object o = items.get(i); if (o instanceof Atom) { os.writeBytes(((Atom)o).string); } else if (o instanceof Number) { os.writeBytes(((Number)o).toString()); } else if (o instanceof AString) { astring(((AString)o).bytes, protocol); } else if (o instanceof NString) { nstring(((NString)o).bytes, protocol); } else if (o instanceof byte[]) { literal((byte[])o, protocol); } else if (o instanceof ByteArrayOutputStream) { literal((ByteArrayOutputStream)o, protocol); } else if (o instanceof Literal) { literal((Literal)o, protocol); } else if (o instanceof Argument) { os.write('('); // open parans ((Argument)o).write(protocol); os.write(')'); // close parans } } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private void nastring(byte[] bytes, Protocol protocol, boolean doQuote) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); int len = bytes.length;
/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
/** * Write out given String as either NIL, QuotedString, or Literal. */ private void nstring(byte[] bytes, Protocol protocol) throws IOException, ProtocolException { if (bytes == null) { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); os.writeBytes("NIL"); } else nastring(bytes, protocol, true); }
public void write(Protocol protocol) throws IOException, ProtocolException { int size = items != null ? items.size() : 0; DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); for (int i=0; i < size; i++) { if (i > 0) // write delimiter if not the first item os.write(' '); Object o = items.elementAt(i); if (o instanceof Atom) { os.writeBytes(((Atom)o).string); } else if (o instanceof Number) { os.writeBytes(((Number)o).toString()); } else if (o instanceof AString) { astring(((AString)o).bytes, protocol); } else if (o instanceof byte[]) { literal((byte[])o, protocol); } else if (o instanceof ByteArrayOutputStream) { literal((ByteArrayOutputStream)o, protocol); } else if (o instanceof Literal) { literal((Literal)o, protocol); } else if (o instanceof Argument) { os.write('('); // open parans ((Argument)o).write(protocol); os.write(')'); // close parans } } }
public void write(Protocol protocol) throws IOException, ProtocolException { int size = items != null ? items.size() : 0; DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); for (int i=0; i < size; i++) { if (i > 0) // write delimiter if not the first item os.write(' '); Object o = items.elementAt(i); if (o instanceof Atom) { os.writeBytes(((Atom)o).string); } else if (o instanceof Number) { os.writeBytes(((Number)o).toString()); } else if (o instanceof AString) { astring(((AString)o).bytes, protocol); } else if (o instanceof byte[]) { literal((byte[])o, protocol); } else if (o instanceof ByteArrayOutputStream) { literal((ByteArrayOutputStream)o, protocol); } else if (o instanceof Literal) { literal((Literal)o, protocol); } else if (o instanceof Argument) { os.write('('); // open parans ((Argument)o).write(protocol); os.write(')'); // close parans } } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }
private OutputStream startLiteral(Protocol protocol, int size) throws IOException, ProtocolException { DataOutputStream os = (DataOutputStream)protocol.getOutputStream(); boolean nonSync = protocol.supportsNonSyncLiterals(); os.write('{'); os.writeBytes(Integer.toString(size)); if (nonSync) // server supports non-sync literals os.writeBytes("+}\r\n"); else os.writeBytes("}\r\n"); os.flush(); // If we are using synchronized literals, wait for the server's // continuation signal if (!nonSync) { for (; ;) { Response r = protocol.readResponse(); if (r.isContinuation()) break; if (r.isTagged()) throw new LiteralException(r); // XXX - throw away untagged responses; // violates IMAP spec, hope no servers do this } } return os; } }