2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package org.apache.log4j.spi;
19 import java.io.PrintWriter;
20 import java.util.Vector;
23 * VectorWriter is an obsolete class provided only for
24 * binary compatibility with earlier versions of log4j and should not be used.
28 class VectorWriter extends PrintWriter {
36 super(new NullWriter());
40 public void print(Object o) {
41 v.addElement(String.valueOf(o));
44 public void print(char[] chars) {
45 v.addElement(new String(chars));
48 public void print(String s) {
52 public void println(Object o) {
53 v.addElement(String.valueOf(o));
56 // JDK 1.1.x apprenly uses this form of println while in
59 void println(char[] chars) {
60 v.addElement(new String(chars));
64 void println(String s) {
68 public void write(char[] chars) {
69 v.addElement(new String(chars));
72 public void write(char[] chars, int off, int len) {
73 v.addElement(new String(chars, off, len));
76 public void write(String s, int off, int len) {
77 v.addElement(s.substring(off, off+len));
80 public void write(String s) {
84 public String[] toStringArray() {
86 String[] sa = new String[len];
87 for(int i = 0; i < len; i++) {
88 sa[i] = (String) v.elementAt(i);