public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
@Override public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
@Override public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
@Override public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ @Override public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ @Override public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
/** * Since the converter will use append, it is possible to get chars to * be removed from the buffer for "writing". Since the chars have already * been read before, they are ignored. If a mark was set, then the * mark is lost. */ @Override public void realWriteChars(char c[], int off, int len) throws IOException { markPos = -1; cb.setOffset(0); cb.setEnd(0); }
@Override public CharSequence subSequence(int start, int end) { try { CharChunk result = (CharChunk) this.clone(); result.setOffset(this.start + start); result.setEnd(this.start + end); return result; } catch (CloneNotSupportedException e) { // Cannot happen return null; } }
@Override public void mark(int readAheadLimit) throws IOException { if (closed) throw new IOException(sm.getString("inputBuffer.streamClosed")); if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); } else { if ((cb.getBuffer().length > (2 * size)) && (cb.getLength()) < (cb.getStart())) { System.arraycopy(cb.getBuffer(), cb.getStart(), cb.getBuffer(), 0, cb.getLength()); cb.setEnd(cb.getLength()); cb.setOffset(0); } } cb.setLimit(cb.getStart() + readAheadLimit + size); markPos = cb.getStart(); }
@Override public void mark(int readAheadLimit) throws IOException { if (closed) throw new IOException(sm.getString("inputBuffer.streamClosed")); if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); } else { if ((cb.getBuffer().length > (2 * size)) && (cb.getLength()) < (cb.getStart())) { System.arraycopy(cb.getBuffer(), cb.getStart(), cb.getBuffer(), 0, cb.getLength()); cb.setEnd(cb.getLength()); cb.setOffset(0); } } cb.setLimit(cb.getStart() + readAheadLimit + size); markPos = cb.getStart(); }
@Override public void mark(int readAheadLimit) throws IOException { if (closed) throw new IOException(sm.getString("inputBuffer.streamClosed")); if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); } else { if ((cb.getBuffer().length > (2 * size)) && (cb.getLength()) < (cb.getStart())) { System.arraycopy(cb.getBuffer(), cb.getStart(), cb.getBuffer(), 0, cb.getLength()); cb.setEnd(cb.getLength()); cb.setOffset(0); } } cb.setLimit(cb.getStart() + readAheadLimit + size); markPos = cb.getStart(); }
@Override public void mark(int readAheadLimit) throws IOException { if (closed) { throw new IOException(sm.getString("inputBuffer.streamClosed")); } if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); } else { if ((cb.getBuffer().length > (2 * size)) && (cb.getLength()) < (cb.getStart())) { System.arraycopy(cb.getBuffer(), cb.getStart(), cb.getBuffer(), 0, cb.getLength()); cb.setEnd(cb.getLength()); cb.setOffset(0); } } cb.setLimit(cb.getStart() + readAheadLimit + size); markPos = cb.getStart(); }
public void mark(int readAheadLimit) throws IOException { if (cb.getLength() <= 0) { cb.setOffset(0); cb.setEnd(0); } else { if ((cb.getBuffer().length > (2 * size)) && (cb.getLength()) < (cb.getStart())) { System.arraycopy(cb.getBuffer(), cb.getStart(), cb.getBuffer(), 0, cb.getLength()); cb.setEnd(cb.getLength()); cb.setOffset(0); } } int offset = readAheadLimit; if (offset < size) { offset = size; } cb.setLimit(cb.getStart() + offset); markPos = cb.getStart(); }
public int realReadChars(char cbuf[], int off, int len) throws IOException { if (!gotEnc) setConverter(); if (bb.getLength() <= 0) { int nRead = realReadBytes(bb.getBytes(), 0, bb.getBytes().length); if (nRead < 0) { return -1; } } if (markPos == -1) { cb.setOffset(0); cb.setEnd(0); } int limit = bb.getLength()+cb.getStart(); if ( cb.getLimit() < limit ) cb.setLimit(limit); state = CHAR_STATE; conv.convert(bb, cb, bb.getLength()); bb.setOffset(bb.getEnd()); return cb.getLength(); }