01: /*
02: * Copyright (C) 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 26. June 2007 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.benchmark.strings.targets;
12:
13: import com.thoughtworks.xstream.tools.benchmark.Target;
14:
15: import org.apache.commons.io.IOUtils;
16:
17: import java.io.IOException;
18:
19: /**
20: * A small java.lang.String target.
21: *
22: * @author Jörg Schaible
23: * @see com.thoughtworks.xstream.tools.benchmark.Harness
24: * @see Target
25: */
26: public class BigString implements Target {
27:
28: private final String string;
29:
30: public BigString() {
31: try {
32: string = IOUtils.toString(getClass().getResourceAsStream(
33: "eclipse-build-log.txt"));
34: } catch (IOException e) {
35: throw new RuntimeException(
36: "Cannot create big String target", e);
37: }
38: }
39:
40: public String toString() {
41: return "Big string";
42: }
43:
44: public Object target() {
45: return string;
46: }
47:
48: public boolean isEqual(Object other) {
49: return string.equals(other);
50: }
51: }
|