Java Doc for Buffer.java in  » Sevlet-Container » jetty-modules » org » mortbay » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » jetty modules » org.mortbay.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.mortbay.io.Buffer

All known Subclasses:   org.mortbay.io.AbstractBuffer,
Buffer
public interface Buffer extends Cloneable(Code)
Byte Buffer interface. This is a byte buffer that is designed to work like a FIFO for bytes. Puts and Gets operate on different pointers into the buffer and the valid _content of the buffer is always between the getIndex and the putIndex. This buffer interface is designed to be similar, but not dependant on the java.nio buffers, which may be used to back an implementation of this Buffer. The main difference is that NIO buffer after a put have their valid _content before the position and a flip is required to access that data. For this buffer it is always true that: markValue <= getIndex <= putIndex <= capacity
author:
   gregw
version:
   1.0

Inner Class :public interface CaseInsensitve

Field Summary
final public static  intIMMUTABLEREADONLYREADWRITE
    
final public  booleanNON_VOLATILE
    
final public  booleanVOLATILE
    


Method Summary
 byte[]array()
     Get the underlying array, if one exists.
 byte[]asArray()
    
 BufferasImmutableBuffer()
    
 BufferasMutableBuffer()
    
 BufferasNonVolatileBuffer()
    
 BufferasReadOnlyBuffer()
    
 Bufferbuffer()
     Get the unerlying buffer.
 intcapacity()
     The capacity of the buffer.
 voidclear()
     Clear the buffer.
 voidcompact()
     Compact the buffer by discarding bytes before the postion (or mark if set).
 booleanequalsIgnoreCase(Buffer buffer)
    
 byteget()
     Get the byte at the current getIndex and increment it.
 intget(byte[] b, int offset, int length)
     Get bytes from the current postion and put them into the passed byte array. The getIndex is incremented by the number of bytes copied into the array.
Parameters:
  b - The byte array to fill.
Parameters:
  offset - Offset in the array.
Parameters:
  length - The max number of bytes to read.
 Bufferget(int length)
    
 intgetIndex()
     The index within the buffer that will next be read or written.
 booleanhasContent()
    
 booleanisImmutable()
    
 booleanisReadOnly()
     a boolean value true if the buffer is readonly.
 booleanisVolatile()
     a boolean value true if the buffer contents may change via alternate paths than this buffer.
 intlength()
    
 voidmark()
     Set the mark to the current getIndex.
 voidmark(int offset)
    
 intmarkIndex()
     The current index of the mark.
 bytepeek()
     Get the byte at the current getIndex without incrementing the getIndex.
 bytepeek(int index)
     Get the byte at a specific index in the buffer.
 Bufferpeek(int index, int length)
    
 intpeek(int index, byte[] b, int offset, int length)
    
 intpoke(int index, Buffer src)
     Put the contents of the buffer at the specific index.
Parameters:
  index - an int value
Parameters:
  src - a Buffer.
 voidpoke(int index, byte b)
     Put a specific byte to a specific getIndex.
 intpoke(int index, byte b, int offset, int length)
     Put a specific byte to a specific getIndex.
 intput(Buffer src)
     Write the bytes from the source buffer to the current getIndex.
Parameters:
  src - The source Buffer it is not modified.
 voidput(byte b)
     Put a byte to the current getIndex and increment the getIndex.
 intput(byte[] b, int offset, int length)
     Put a byte to the current getIndex and increment the getIndex.
 intput(byte[] b)
     Put a byte to the current getIndex and increment the getIndex.
 intputIndex()
     The index of the first element that should not be read.
 intreadFrom(InputStream in, int max)
    
 voidreset()
    
 voidsetGetIndex(int newStart)
     Set the buffers start getIndex.
 voidsetMarkIndex(int newMark)
     Set a specific value for the mark.
 voidsetPutIndex(int newLimit)
    
 intskip(int n)
     Skip _content.
 Bufferslice()
    
 BuffersliceFromMark()
    
 BuffersliceFromMark(int length)
    
 intspace()
     the space remaining in the buffer.
 StringtoDetailString()
    
 voidwriteTo(OutputStream out)
    

Field Detail
IMMUTABLEREADONLYREADWRITE
final public static int IMMUTABLEREADONLYREADWRITE(Code)



NON_VOLATILE
final public boolean NON_VOLATILE(Code)



VOLATILE
final public boolean VOLATILE(Code)





Method Detail
array
byte[] array()(Code)
Get the underlying array, if one exists. a byte[] backing this buffer or null if none exists.



asArray
byte[] asArray()(Code)
a byte[] value of the bytes from the getIndex to the putIndex.



asImmutableBuffer
Buffer asImmutableBuffer()(Code)
an immutable version of this Buffer.



asMutableBuffer
Buffer asMutableBuffer()(Code)
an immutable version of this Buffer.



asNonVolatileBuffer
Buffer asNonVolatileBuffer()(Code)
a non volitile version of this Buffer value



asReadOnlyBuffer
Buffer asReadOnlyBuffer()(Code)
a readonly version of this Buffer.



buffer
Buffer buffer()(Code)
Get the unerlying buffer. If this buffer wraps a backing buffer. The root backing buffer or this if there is no backing buffer;



capacity
int capacity()(Code)
The capacity of the buffer. This is the maximum putIndex that may be set. an int value



clear
void clear()(Code)
Clear the buffer. getIndex=0, putIndex=0.



compact
void compact()(Code)
Compact the buffer by discarding bytes before the postion (or mark if set). Bytes from the getIndex (or mark) to the putIndex are moved to the beginning of the buffer and the values adjusted accordingly.



equalsIgnoreCase
boolean equalsIgnoreCase(Buffer buffer)(Code)
a boolean value true if case sensitive comparison on this buffer



get
byte get()(Code)
Get the byte at the current getIndex and increment it. The byte value from the current getIndex.



get
int get(byte[] b, int offset, int length)(Code)
Get bytes from the current postion and put them into the passed byte array. The getIndex is incremented by the number of bytes copied into the array.
Parameters:
  b - The byte array to fill.
Parameters:
  offset - Offset in the array.
Parameters:
  length - The max number of bytes to read. The number of bytes actually read.



get
Buffer get(int length)(Code)

Parameters:
  length - an int value a Buffer value



getIndex
int getIndex()(Code)
The index within the buffer that will next be read or written. an int value >=0 <= putIndex()



hasContent
boolean hasContent()(Code)
true of putIndex > getIndex



isImmutable
boolean isImmutable()(Code)
a boolean value true if the buffer is immutable and that neitherthe buffer contents nor the indexes may be changed.



isReadOnly
boolean isReadOnly()(Code)
a boolean value true if the buffer is readonly. The buffer indexes maybe modified, but the buffer contents may not. For example a View onto an immutable Buffer will beread only.



isVolatile
boolean isVolatile()(Code)
a boolean value true if the buffer contents may change via alternate paths than this buffer. If the contents of this buffer are to be used outside of thecurrent context, then a copy must be made.



length
int length()(Code)
The number of bytes from the getIndex to the putIndex an int == putIndex()-getIndex()



mark
void mark()(Code)
Set the mark to the current getIndex.



mark
void mark(int offset)(Code)
Set the mark relative to the current getIndex
Parameters:
  offset - an int value to add to the current getIndex to obtain the mark value.



markIndex
int markIndex()(Code)
The current index of the mark. an int index in the buffer or -1 if the mark is not set.



peek
byte peek()(Code)
Get the byte at the current getIndex without incrementing the getIndex. The byte value from the current getIndex.



peek
byte peek(int index)(Code)
Get the byte at a specific index in the buffer.
Parameters:
  index - an int value a byte value



peek
Buffer peek(int index, int length)(Code)

Parameters:
  index - an int value
Parameters:
  length - an int value The Buffer value from the requested getIndex.



peek
int peek(int index, byte[] b, int offset, int length)(Code)

Parameters:
  index - an int value
Parameters:
  b - The byte array to peek into
Parameters:
  offset - The offset into the array to start peeking
Parameters:
  length - an int value The number of bytes actually peeked



poke
int poke(int index, Buffer src)(Code)
Put the contents of the buffer at the specific index.
Parameters:
  index - an int value
Parameters:
  src - a Buffer. If the source buffer is not modified The number of bytes actually poked



poke
void poke(int index, byte b)(Code)
Put a specific byte to a specific getIndex.
Parameters:
  index - an int value
Parameters:
  b - a byte value



poke
int poke(int index, byte b, int offset, int length)(Code)
Put a specific byte to a specific getIndex.
Parameters:
  index - an int value
Parameters:
  b - a byte array value The number of bytes actually poked



put
int put(Buffer src)(Code)
Write the bytes from the source buffer to the current getIndex.
Parameters:
  src - The source Buffer it is not modified. The number of bytes actually poked



put
void put(byte b)(Code)
Put a byte to the current getIndex and increment the getIndex.
Parameters:
  b - a byte value



put
int put(byte[] b, int offset, int length)(Code)
Put a byte to the current getIndex and increment the getIndex.
Parameters:
  b - a byte value The number of bytes actually poked



put
int put(byte[] b)(Code)
Put a byte to the current getIndex and increment the getIndex.
Parameters:
  b - a byte value The number of bytes actually poked



putIndex
int putIndex()(Code)
The index of the first element that should not be read. an int value >= getIndex()



readFrom
int readFrom(InputStream in, int max) throws IOException(Code)
Read the buffer's contents from the input stream
Parameters:
  in - input stream
Parameters:
  max - maximum number of bytes that may be read actual number of bytes read or -1 for EOF



reset
void reset()(Code)
Reset the current getIndex to the mark



setGetIndex
void setGetIndex(int newStart)(Code)
Set the buffers start getIndex.
Parameters:
  newStart - an int value



setMarkIndex
void setMarkIndex(int newMark)(Code)
Set a specific value for the mark.
Parameters:
  newMark - an int value



setPutIndex
void setPutIndex(int newLimit)(Code)

Parameters:
  newLimit - an int value



skip
int skip(int n)(Code)
Skip _content. The getIndex is updated by min(remaining(), n)
Parameters:
  n - The number of bytes to skip the number of bytes skipped.



slice
Buffer slice()(Code)
a volitile Buffer from the postion to the putIndex.



sliceFromMark
Buffer sliceFromMark()(Code)
a volitile Buffer value from the mark to the putIndex



sliceFromMark
Buffer sliceFromMark(int length)(Code)

Parameters:
  length - an int value a valitile Buffer value from the mark of the length requested.



space
int space()(Code)
the space remaining in the buffer. capacity - putIndex



toDetailString
String toDetailString()(Code)
a String value describing the state and contents of the buffer.



writeTo
void writeTo(OutputStream out) throws IOException(Code)
Write the buffer's contents to the output stream
Parameters:
  out -



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.