KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jvnet > fastinfoset > AccessibleByteBufferOutputStream


1 package org.jvnet.fastinfoset;
2
3 import java.io.OutputStream JavaDoc;
4
5 public abstract class AccessibleByteBufferOutputStream extends OutputStream JavaDoc {
6     
7     /**
8      * Get the byte buffer.
9      *
10      * <p>The application shall modify the byte
11      * array within the the range (getStart(),
12      * getStart() + getLength()].<p>
13      *
14      * @return The underlying byte array to write to
15      */

16     public abstract byte[] getBuffer();
17     
18     /**
19      * Get the byte buffer.
20      *
21      * <p>The application shall modify the byte
22      * array within the the range (getStart(),
23      * getStart() + getLength()].<p>
24      *
25      * @param length The length of bytes of the byte array that need to be modified
26      * @return The byte array. Null is returned if the length
27      * requested is too large.
28      */

29     public abstract byte[] getBuffer(int length);
30     
31     /**
32      * Commit bytes to the byte buffer.
33      *
34      * <p>The bytes committed shall be in the range (getStart(), getStart() + length].<p>
35      *
36      * <p>If the method completed without error then getStart() after the call will be
37      * equal to getStart() + length before the call, and getLength() after the call will
38      * be equal to getLength() - length before the call.<p>
39      *
40      * <p>The length shall be > 0 and <= getLength().<p>
41      *
42      * @param length The length of bytes in the byte array to commit.
43      */

44     public abstract void commitBytes(int length);
45     
46     /**
47      * Get the start position to modify bytes in the byte buffer.
48      *
49      * @return The start position in the byte array.
50      */

51     public abstract int getStart();
52     
53     /**
54      * Get the length of bytes that can be modified in the byte buffer.
55      *
56      * @return The length of bytes in the byte array.
57      */

58     public abstract int getLength();
59 }
60
Popular Tags