import charite.christo.strap.StrapProtein; import charite.christo.interfaces.ProteinWriter; import charite.christo.protein.ProteinWriter1; import charite.christo.ByteArray; /* java DemoProteinWriter A ProteinWriter produces a text representation of a protein object. Here charite.christo.protein.ProteinWriter1 is used. It supports several formats. Since java.lang.StringBuffer exhibits limitations and performance problems, STRAP uses its own implementation of StringBuffer: ByteArray. */ public class DemoProteinWriter { public static void main(String argv[]) { /* Create a protein object with a short sequence */ StrapProtein p=new StrapProtein(); p.setResidueType("ASDFGHKL"); p.setName("protein1"); /* initialize a ProteinWriter instance with the protein instance */ ProteinWriter proteinWriter=new ProteinWriter1(); final long mode=ProteinWriter.FASTA; final ByteArray sb=new ByteArray(999); /* Append the text to the ByteArray */ proteinWriter.toText(p,null,mode,sb); System.out.println(sb); System.exit(0); } }