From ad33d302ffca61035fd7ccb19f6ff0a7a43e0e38 Mon Sep 17 00:00:00 2001 From: gojomo Date: Thu, 14 May 2009 21:12:34 +0000 Subject: [PATCH] copying noah's work to h3 [HER-1506] correct javadoc on use of these classes * GenericReplayCharSequence.java * Latin1ByteReplayCharSequence.java --- .../main/java/org/archive/io/GenericReplayCharSequence.java | 6 +++--- .../java/org/archive/io/Latin1ByteReplayCharSequence.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/commons/src/main/java/org/archive/io/GenericReplayCharSequence.java b/commons/src/main/java/org/archive/io/GenericReplayCharSequence.java index 66c95bba..e178b588 100644 --- a/commons/src/main/java/org/archive/io/GenericReplayCharSequence.java +++ b/commons/src/main/java/org/archive/io/GenericReplayCharSequence.java @@ -39,9 +39,9 @@ import java.util.logging.Logger; * buffer and overflow backing file) that can handle streams of multibyte * characters. * - * If possible, use {@link Latin1ByteReplayCharSequence}. It performs better even - * for the single byte case (Decoding is an expensive process). - * + * For better performance on ISO-8859-1 text, use + * {@link Latin1ByteReplayCharSequence}. + * *

Call close on this class when done so can clean up resources. * *

Implementation currently works by checking to see if content to read diff --git a/commons/src/main/java/org/archive/io/Latin1ByteReplayCharSequence.java b/commons/src/main/java/org/archive/io/Latin1ByteReplayCharSequence.java index 16c26afd..4742572b 100644 --- a/commons/src/main/java/org/archive/io/Latin1ByteReplayCharSequence.java +++ b/commons/src/main/java/org/archive/io/Latin1ByteReplayCharSequence.java @@ -33,7 +33,9 @@ import org.archive.util.DevUtils; * Provides a (Replay)CharSequence view on recorded stream bytes (a prefix * buffer and overflow backing file). * - * Treats the byte stream as 8-bit. + * Assumes the byte stream is ISO-8859-1 text, taking advantage of the fact + * that each byte in the stream corresponds to a single unicode character with + * the same numerical value as the byte. * *

Uses a wraparound rolling buffer of the last windowSize bytes read * from disk in memory; as long as the 'random access' of a CharSequence