Java Doc for CachedIoAdapter.java in  » Database-DBMS » db4o-6.4 » com » db4o » 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 » Database DBMS » db4o 6.4 » com.db4o.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.db4o.io.IoAdapter
      com.db4o.io.CachedIoAdapter

CachedIoAdapter
public class CachedIoAdapter extends IoAdapter (Code)
CachedIoAdapter is an IOAdapter for random access files, which caches data for IO access. Its functionality is similar to OS cache.
Example:
delegateAdapter = new RandomAccessFileAdapter();
Db4o.configure().io(new CachedIoAdapter(delegateAdapter));



Constructor Summary
public  CachedIoAdapter(IoAdapter ioAdapter)
     Creates an instance of CachedIoAdapter with the default page size and page count.
public  CachedIoAdapter(IoAdapter ioAdapter, int pageSize, int pageCount)
    
public  CachedIoAdapter(String path, boolean lockFile, long initialLength, boolean readOnly, IoAdapter io, int pageSize, int pageCount)
    

Method Summary
public  voidclose()
    
public  IoAdapterdelegatedIoAdapter()
    
public  voiddelete(String path)
    
public  booleanexists(String path)
    
public  longgetLength()
    
public  IoAdapteropen(String path, boolean lockFile, long initialLength, boolean readOnly)
    
public  intread(byte[] buffer, int length)
     Reads the file into the buffer using pages from cache.
public  voidseek(long pos)
    
public  voidsync()
    
public  voidwrite(byte[] buffer, int length)
    


Constructor Detail
CachedIoAdapter
public CachedIoAdapter(IoAdapter ioAdapter)(Code)
Creates an instance of CachedIoAdapter with the default page size and page count.
Parameters:
  ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default)



CachedIoAdapter
public CachedIoAdapter(IoAdapter ioAdapter, int pageSize, int pageCount)(Code)
Creates an instance of CachedIoAdapter with a custom page size and page count.

Parameters:
  ioAdapter - delegate IO adapter (RandomAccessFileAdapter by default)
Parameters:
  pageSize - cache page size
Parameters:
  pageCount - allocated amount of pages



CachedIoAdapter
public CachedIoAdapter(String path, boolean lockFile, long initialLength, boolean readOnly, IoAdapter io, int pageSize, int pageCount) throws Db4oIOException(Code)
Creates an instance of CachedIoAdapter with extended parameters.

Parameters:
  path - database file path
Parameters:
  lockFile - determines if the file should be locked
Parameters:
  initialLength - initial file length, new writes will start from this point
Parameters:
  readOnly - if the file should be used in read-onlyt mode.
Parameters:
  io - delegate IO adapter (RandomAccessFileAdapter by default)
Parameters:
  pageSize - cache page size
Parameters:
  pageCount - allocated amount of pages




Method Detail
close
public void close() throws Db4oIOException(Code)
Flushes and closes the file



delegatedIoAdapter
public IoAdapter delegatedIoAdapter()(Code)



delete
public void delete(String path)(Code)
Deletes the database file
Parameters:
  path - file path



exists
public boolean exists(String path)(Code)
Checks if the file exists
Parameters:
  path - file path



getLength
public long getLength() throws Db4oIOException(Code)
Returns the file length



open
public IoAdapter open(String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException(Code)
Creates and returns a new CachedIoAdapter

Parameters:
  path - database file path
Parameters:
  lockFile - determines if the file should be locked
Parameters:
  initialLength - initial file length, new writes will start from this point



read
public int read(byte[] buffer, int length) throws Db4oIOException(Code)
Reads the file into the buffer using pages from cache. If the next page is not cached it will be read from the file.
Parameters:
  buffer - destination buffer
Parameters:
  length - how many bytes to read



seek
public void seek(long pos) throws Db4oIOException(Code)
Moves the pointer to the specified file position
Parameters:
  pos - position within the file



sync
public void sync() throws Db4oIOException(Code)
Flushes cache to a physical storage



write
public void write(byte[] buffer, int length) throws Db4oIOException(Code)
Writes the buffer to cache using pages
Parameters:
  buffer - source buffer
Parameters:
  length - how many bytes to write



Methods inherited from com.db4o.io.IoAdapter
public void blockCopy(int oldAddress, int oldAddressOffset, int newAddress, int newAddressOffset, int length) throws Db4oIOException(Code)(Java Doc)
public void blockSeek(int address) throws Db4oIOException(Code)(Java Doc)
public void blockSeek(int address, int offset) throws Db4oIOException(Code)(Java Doc)
public void blockSize(int blockSize)(Code)(Java Doc)
public int blockSize()(Code)(Java Doc)
abstract public void close() throws Db4oIOException(Code)(Java Doc)
public void copy(long oldAddress, long newAddress, int length) throws Db4oIOException(Code)(Java Doc)
public IoAdapter delegatedIoAdapter()(Code)(Java Doc)
abstract public void delete(String path)(Code)(Java Doc)
abstract public boolean exists(String path)(Code)(Java Doc)
abstract public long getLength() throws Db4oIOException(Code)(Java Doc)
abstract public IoAdapter open(String path, boolean lockFile, long initialLength, boolean readOnly) throws Db4oIOException(Code)(Java Doc)
public int read(byte[] buffer) throws Db4oIOException(Code)(Java Doc)
abstract public int read(byte[] bytes, int length) throws Db4oIOException(Code)(Java Doc)
final protected long regularAddress(int blockAddress, int blockAddressOffset)(Code)(Java Doc)
abstract public void seek(long pos) throws Db4oIOException(Code)(Java Doc)
abstract public void sync() throws Db4oIOException(Code)(Java Doc)
public void write(byte[] bytes) throws Db4oIOException(Code)(Java Doc)
abstract public void write(byte[] buffer, int length) throws Db4oIOException(Code)(Java Doc)

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.