Java Doc for ByteToCharConverter.java in  » Web-Framework » RSF » uk » org » ponder » stringutil » 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 » Web Framework » RSF » uk.org.ponder.stringutil 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   uk.org.ponder.stringutil.ByteToCharConverter

All known Subclasses:   uk.org.ponder.stringutil.ByteToCharUTF8,
ByteToCharConverter
abstract public class ByteToCharConverter (Code)
This abstract class forms part of the fast and better instrumented uk.org.ponder.streamutil.DirectInputStreamReader architecture. It is intended as a base class for specific byte to character decoders (such as ByteToCharUTF8), and abstracts away the non-stream and non-encoding specific tasks of working out whether anything needs doing or not, and if so how much and where it is.


Field Summary
final public static  intSTOP_INPUT_EXHAUSTED
     Return code from convert() indicating conversion stopped because there was no space left in the input buffer.
final public static  intSTOP_INPUT_EXHAUSTED_EXACTLY
     Return code from convert() indicating conversion stopped because there was no input left in the input buffer, but also that no partial input sequence was left in it.
final public static  intSTOP_OUTPUT_EXHAUSTED
     Return code from convert() indicating conversion stopped because there was no space left in the output buffer.
protected  byte[]inbuffer
    
protected  intinbufferlimit
    
protected  intinbufferpos
    
protected  intinput_sequence_length
    
protected  intlinenumber
    
protected  char[]outbuffer
    
protected  intoutbufferlimit
    
protected  intoutbufferpos
    
protected  intoutput_sequence_length
    
protected  inttotalbytesin
    

Constructor Summary
public  ByteToCharConverter()
    

Method Summary
public  voidblastState()
     Destroy all the state stored in this converter, so it holds no resources and is ready to begin conversion again.
abstract public  intconvert()
     Convert as many bytes from inbuffer to characters in outbuffer as possible.
public  voidensureInputBuffer(int buffersize)
     Ensure that the current input buffer is big enough to accommodate the specified number of input bytes, by reallocating it if necessary.
abstract public  StringgetCharacterEncoding()
    
public  byte[]getInputBuffer()
    
public  intgetInputBufferLimit()
    
abstract public  intgetMaxOutput(int inputsize)
     Returns the maximum possible number of characters that could be decoded from an input byte sequence of the specified length.
public  intgetOutputBufferPos()
    
public  voidhandleEncodingError(String errortype)
     Trigger an encoding error to be delivered to any registered EncodingErrorHandler. There is one sort of error that can only be detected from the outside of this class, namely an incomplete input sequence but no further input available.
public  voidincreaseInputBufferLimit(int bytesread)
    
public  intmissing_bytes()
     Returns the number of bytes needed to complete the current input sequence.
public  voidsetEncodingErrorHandler(EncodingErrorHandler errorhandler)
     Sets the error handler that will be used to report errors encountered in the byte encoding of the data.
public  voidsetOutputBuffer(char[] outbuffer, int outbufferpos, int outbufferlimit)
     Sets the output buffer to which decoded character data should be written.
Parameters:
  outbuffer - A character buffer to which character data can be written.
Parameters:
  outbufferpos - The position within the buffer to which the character datacan be written.
Parameters:
  outbufferlimit - The index of the logical end of the buffer.
public  voidswizzInputBuffer()
    

Field Detail
STOP_INPUT_EXHAUSTED
final public static int STOP_INPUT_EXHAUSTED(Code)
Return code from convert() indicating conversion stopped because there was no space left in the input buffer.



STOP_INPUT_EXHAUSTED_EXACTLY
final public static int STOP_INPUT_EXHAUSTED_EXACTLY(Code)
Return code from convert() indicating conversion stopped because there was no input left in the input buffer, but also that no partial input sequence was left in it.



STOP_OUTPUT_EXHAUSTED
final public static int STOP_OUTPUT_EXHAUSTED(Code)
Return code from convert() indicating conversion stopped because there was no space left in the output buffer.



inbuffer
protected byte[] inbuffer(Code)



inbufferlimit
protected int inbufferlimit(Code)



inbufferpos
protected int inbufferpos(Code)



input_sequence_length
protected int input_sequence_length(Code)



linenumber
protected int linenumber(Code)



outbuffer
protected char[] outbuffer(Code)



outbufferlimit
protected int outbufferlimit(Code)



outbufferpos
protected int outbufferpos(Code)



output_sequence_length
protected int output_sequence_length(Code)



totalbytesin
protected int totalbytesin(Code)




Constructor Detail
ByteToCharConverter
public ByteToCharConverter()(Code)




Method Detail
blastState
public void blastState()(Code)
Destroy all the state stored in this converter, so it holds no resources and is ready to begin conversion again.



convert
abstract public int convert()(Code)
Convert as many bytes from inbuffer to characters in outbuffer as possible. The return codes from this method are listed above, indicating which out of the input and the output was actually exhausted.



ensureInputBuffer
public void ensureInputBuffer(int buffersize)(Code)
Ensure that the current input buffer is big enough to accommodate the specified number of input bytes, by reallocating it if necessary. This method does not preserve the buffer contents.
Parameters:
  buffersize - The required input buffer size.



getCharacterEncoding
abstract public String getCharacterEncoding()(Code)
Returns the name of the byte to character (UTF-16) encoding performed by this converter



getInputBuffer
public byte[] getInputBuffer()(Code)



getInputBufferLimit
public int getInputBufferLimit()(Code)



getMaxOutput
abstract public int getMaxOutput(int inputsize)(Code)
Returns the maximum possible number of characters that could be decoded from an input byte sequence of the specified length. Currently disused.
Parameters:
  inputsize - The number of input bytes for which the maximum decoded charactersare required.



getOutputBufferPos
public int getOutputBufferPos()(Code)



handleEncodingError
public void handleEncodingError(String errortype)(Code)
Trigger an encoding error to be delivered to any registered EncodingErrorHandler. There is one sort of error that can only be detected from the outside of this class, namely an incomplete input sequence but no further input available. For this reason this method has been given public access to allow an error report to be triggered externally
Parameters:
  errortype - A String reprenting the type of the error that has occurred.This string will be passed on via the EncodingErrorHandler interface.



increaseInputBufferLimit
public void increaseInputBufferLimit(int bytesread)(Code)



missing_bytes
public int missing_bytes()(Code)
Returns the number of bytes needed to complete the current input sequence. the number of bytes needed toc complete the current input sequence.positive if we need more bytes to complete the current sequence, zero if we have exactlyused up all input, negative if there is more input remaining.



setEncodingErrorHandler
public void setEncodingErrorHandler(EncodingErrorHandler errorhandler)(Code)
Sets the error handler that will be used to report errors encountered in the byte encoding of the data.
Parameters:
  errorhandler - An interface through which decoding errors may be reported.



setOutputBuffer
public void setOutputBuffer(char[] outbuffer, int outbufferpos, int outbufferlimit)(Code)
Sets the output buffer to which decoded character data should be written.
Parameters:
  outbuffer - A character buffer to which character data can be written.
Parameters:
  outbufferpos - The position within the buffer to which the character datacan be written.
Parameters:
  outbufferlimit - The index of the logical end of the buffer. If datais written exactly up to this point, the buffer will be considered full anddecoding will stop until another buffer is supplied.



swizzInputBuffer
public void swizzInputBuffer()(Code)
Reorganise the input buffer by rotating the current input point to the beginning, ready to receive more input after inbufferlimit



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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