| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nothome.delta.text.GDiffTextWriter
public class GDiffTextWriter
A text-file format analog for GDIFF, which is only supported for binary streams. The output follows the following extended BNF format:
 gdiff-text ::= header , { copy | data }
 header ::= 'gdt' , { version } , '\n'
 copy   ::= 'y' offset ',' length '\n'
 data   ::= 'i' length '\n' text-chunk '\n'
 length ::= hex-digit , { hex-digit }
 offset ::= hex-digit , { hex-digit }
 hex-digit  ::= '0'-'9' | 'a'-'f'
 text-chunk ::= (* arbitrary text string *)
 version ::= '1'-'9'
 
 Note that 'y' is used for copy and 'i' for data since they aren't to be 
 confused with the hex characters 'c' and 'd'.
 
 Note that the length of text-string is capped at CHUNK_SIZE characters
 for this implementation.
 
The initial version is 1 and is optionally indicated. Newer versions may support additional commands and hints.
See also: http://www.w3.org/TR/NOTE-gdiff-19970901.html.
| Field Summary | |
|---|---|
| static int | CHUNK_SIZEMax length of a "text-chunk". | 
| static char | COMMAComma delimiter. | 
| static char | COPYCopy command character. | 
| static char | DATAData command character. | 
| static char | LFLine feed character. | 
| Constructor Summary | |
|---|---|
| GDiffTextWriter(Writer w)Constructs a new GDiffTextWriter. | |
| Method Summary | |
|---|---|
|  void | addCopy(int offset,
        int length)Add a copy command. | 
|  void | addData(char c)Add a character to output. | 
|  void | close()Frees internal resources; closes output stream. | 
|  void | flush()Writes current state to output stream. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final char LF
public static final char COPY
public static final char DATA
public static final char COMMA
public static final int CHUNK_SIZE
| Constructor Detail | 
|---|
public GDiffTextWriter(Writer w)
                throws IOException
w - 
IOException| Method Detail | 
|---|
public void addCopy(int offset,
                    int length)
             throws IOException
DiffTextWriter
addCopy in interface DiffTextWriteroffset - start of sequencelength - length of sequence
IOException
public void addData(char c)
             throws IOException
DiffTextWriter
addData in interface DiffTextWriterIOException
public void flush()
           throws IOException
DiffTextWriter
flush in interface DiffTextWriterIOException
public void close()
           throws IOException
DiffTextWriter
close in interface DiffTextWriterclose in interface CloseableIOException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||