01: /*
02: * $Id: XMLDecoder.java,v 1.3 2004/07/08 08:03:04 yuvalo Exp $
03: *
04: * (C) Copyright 2002-2004 by Yuval Oren. All rights reserved.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package com.bluecast.xml;
20:
21: import java.io.CharConversionException;
22: import com.bluecast.io.CharsetDecoder;
23:
24: /**
25: * Converts bytes to characters while checking for valid XML characters
26: *
27: * @author Yuval Oren
28: * @version $Revision: 1.3 $
29: *
30: */
31: public interface XMLDecoder extends CharsetDecoder {
32:
33: /**
34: * Decodes the XML declaration from an array of bytes into characters.
35: * This method will read at least until a '>' character is found or until a
36: * decoding error occurs. Additional bytes may be decoded, up to a total
37: * of <i>in_len</i>.
38: *
39: * @param in_buf input byte buffer
40: * @param in_off starting byte buffer offset
41: * @param in_len max number of bytes to read
42: * @param out_buf output character buffer
43: * @param out_off char buffer offset at which to start writing
44: * @param out_len max number of chars to write
45: * @param result an array of size >= 2 where results are returned:
46: * result[0] = number of bytes read.
47: * result[1] = number of chars written
48: */
49: public void decodeXMLDecl(byte[] in_buf, int in_off, int in_len,
50: char[] out_buf, int out_off, int out_len, int[] result)
51: throws CharConversionException;
52:
53: public XMLDecoder newXMLDecoder();
54: }
|