/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// CharArr origins
// V1.0 7/06/97
// V1.1 9/21/99
// V1.2 2/02/04 // Java5 features
// V1.3 11/26/06 // Make safe for Java 1.4, work into Noggit
// @author yonik
// Java5 version could look like the following:
// public class CharArr implements CharSequence, Appendable, Readable, Closeable {
/**
* @author yonik
* @version $Id$
*/
protected char[] buf;
protected int start;
protected int end;
public CharArr() {
this(32);
}
}
}
}
}
}
}
//TODO
return 0;
}
public void unsafeWrite(char b) {
}
}
}
}
public void write(char b) {
}
unsafeWrite(b);
}
public final void write(char[] b) {
}
}
}
}
}
public void flush() {
}
public final void reset() {
}
public void close() {
}
public char[] toCharArray() {
return newbuf;
}
}
/***
int sz = size();
if (sz<=0) return -1;
if (sz>0) cb.put(buf, start, sz);
return -1;
***/
while (true) {
fill();
int s = size();
sz += s;
}
}
return 0; // or -1?
}
//////////////// Appendable methods /////////////
}
return null;
}
write(c);
return this;
}
}
public NullCharArr() {
super(new char[1],0,0);
}
public void unsafeWrite(char b) {}
public void unsafeWrite(int b) {}
public void write(char b) {}
return this;
}
return 0;
}
}
}
// IDEA: a subclass that refills the array from a reader?
super(size);
}
}
// empty the buffer and then read direct
}
reset();
} else if (start>0) {
}
/***
// fill fully or not???
do {
int sz = in.read(buf,end,buf.length-end);
if (sz==-1) return;
end+=sz;
} while (end < buf.length);
***/
return sz;
}
}
public void flush() {
try {
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public void write(char b) {
flush();
}
unsafeWrite(b);
}
flush();
} else {
flush();
try {
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
// if the data to write is small enough, buffer it.
flush();
} else {
flush();
// don't buffer, just write to sink
try {
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}