## org.codehaus.groovy.grails.web.util
Class StreamCharBuffer.StringChunk

    java.lang.Object
      org.codehaus.groovy.grails.web.util.StreamCharBuffer.AbstractChunk
          org.codehaus.groovy.grails.web.util.StreamCharBuffer.StringChunk

Enclosing class:
  StreamCharBuffer

    final class StreamCharBuffer.StringChunk

extends StreamCharBuffer.AbstractChunk

StringChunk is a wrapper for java.lang.String. It also keeps state of the read offset and the number of unread characters. There's methods that StringChunkGroup uses for reading data.

Author:
  Lari Hotari

Field Summary
`(package private) int` `lastposition`
`(package private) int` `length`
`(package private) int` `offset`
`(package private) String` `str`

Fields inherited from class org.codehaus.groovy.grails.web.util.StreamCharBuffer.AbstractChunk
`next, prev, writerUsedCounter`

Constructor Summary
`StreamCharBuffer.StringChunk(String str, int offset, int length)`

Method Summary
`StreamCharBuffer.ChunkReader` `getChunkReader(boolean removeAfterReading)`
`boolean` `isSingleBuffer()`
`int` `size()`
`void` `writeTo(Writer target)`

Methods inherited from class org.codehaus.groovy.grails.web.util.StreamCharBuffer.AbstractChunk
`getWriterUsedCounter, subtractFromTotalCount`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### str

    String str

### offset

    int offset

### lastposition

    int lastposition

### length

    int length

Constructor Detail

### StreamCharBuffer.StringChunk

    public StreamCharBuffer.StringChunk(String str,
                                        int offset,
                                        int length)

Method Detail

### getChunkReader

    public StreamCharBuffer.ChunkReader getChunkReader(boolean removeAfterReading)

  Specified by:
    `getChunkReader` in class `StreamCharBuffer.AbstractChunk`

### writeTo

    public void writeTo(Writer target)
                 throws IOException

  Specified by:
    `writeTo` in class `StreamCharBuffer.AbstractChunk`
  Throws:
    `IOException`

### size

    public int size()

  Specified by:
    `size` in class `StreamCharBuffer.AbstractChunk`

### isSingleBuffer

    public boolean isSingleBuffer()

Copyright (c) 2005-2009 The Grails project