4 * License : The MIT License
5 * Copyright(c) 2013 MikuToga Partners
8 package jp.sfjp.mikutoga.bin.parser;
10 import java.io.IOException;
15 * <p>別のパーサにパース処理を委譲する。
17 public class ProxyParser implements BinParser{
19 private final BinParser delegate;
24 * @param delegate 委譲先パーサ
25 * @throws NullPointerException 引数がnull
27 public ProxyParser(BinParser delegate) throws NullPointerException{
30 if(delegate == null) throw new NullPointerException();
31 this.delegate = delegate;
38 * @return {@inheritDoc}
41 public long getPosition() {
42 return this.delegate.getPosition();
47 * @return {@inheritDoc}
48 * @throws IOException {@inheritDoc}
51 public boolean hasMore() throws IOException {
52 return this.delegate.hasMore();
57 * @param skipLength {@inheritDoc}
58 * @throws IOException {@inheritDoc}
59 * @throws MmdEofException {@inheritDoc}
62 public void skip(long skipLength) throws IOException, MmdEofException {
63 this.delegate.skip(skipLength);
69 * @param dst {@inheritDoc}
70 * @param off {@inheritDoc}
71 * @param length {@inheritDoc}
72 * @throws NullPointerException {@inheritDoc}
73 * @throws IndexOutOfBoundsException {@inheritDoc}
74 * @throws IOException {@inheritDoc}
75 * @throws MmdEofException {@inheritDoc}
78 public void parseByteArray(byte[] dst, int off, int length)
79 throws NullPointerException,
80 IndexOutOfBoundsException,
83 this.delegate.parseByteArray(dst, off, length);
89 * @param dst {@inheritDoc}
90 * @throws NullPointerException {@inheritDoc}
91 * @throws IOException {@inheritDoc}
92 * @throws MmdEofException {@inheritDoc}
95 public void parseByteArray(byte[] dst)
96 throws NullPointerException,
99 this.delegate.parseByteArray(dst);
105 * @return {@inheritDoc}
106 * @throws IOException {@inheritDoc}
107 * @throws MmdEofException {@inheritDoc}
110 public byte parseByte() throws IOException, MmdEofException {
111 return this.delegate.parseByte();
116 * @return {@inheritDoc}
117 * @throws IOException {@inheritDoc}
118 * @throws MmdEofException {@inheritDoc}
121 public int parseUByteAsInt() throws IOException, MmdEofException {
122 return this.delegate.parseUByteAsInt();
127 * @return {@inheritDoc}
128 * @throws IOException {@inheritDoc}
129 * @throws MmdEofException {@inheritDoc}
132 public boolean parseBoolean() throws IOException, MmdEofException {
133 return this.delegate.parseBoolean();
138 * @return {@inheritDoc}
139 * @throws IOException {@inheritDoc}
140 * @throws MmdEofException {@inheritDoc}
143 public short parseLeShort() throws IOException, MmdEofException {
144 return this.delegate.parseLeShort();
149 * @return {@inheritDoc}
150 * @throws IOException {@inheritDoc}
151 * @throws MmdEofException {@inheritDoc}
154 public int parseLeUShortAsInt() throws IOException, MmdEofException {
155 return this.delegate.parseLeUShortAsInt();
160 * @return {@inheritDoc}
161 * @throws IOException {@inheritDoc}
162 * @throws MmdEofException {@inheritDoc}
165 public int parseLeInt() throws IOException, MmdEofException {
166 return this.delegate.parseLeInt();
171 * @return {@inheritDoc}
172 * @throws IOException {@inheritDoc}
173 * @throws MmdEofException {@inheritDoc}
176 public float parseLeFloat() throws IOException, MmdEofException {
177 return this.delegate.parseLeFloat();
182 * @param decoder {@inheritDoc}
183 * @param byteLen {@inheritDoc}
184 * @return {@inheritDoc}
185 * @throws IOException {@inheritDoc}
186 * @throws MmdEofException {@inheritDoc}
187 * @throws MmdFormatException {@inheritDoc}
190 public String parseString(TextDecoder decoder, int byteLen)
191 throws IOException, MmdEofException, MmdFormatException {
192 return this.delegate.parseString(decoder, byteLen);