it.unimi.dsi.mg4j.io

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 » Search Engine » mg4j » it.unimi.dsi.mg4j.io 
it.unimi.dsi.mg4j.io
MG4J: Managing Gigabytes for Java

Bit-level I/O classes.

Package Specification

The standard Java API lacks bit-level I/O classes: to this purpose, MG4J provides {@link it.unimi.dsi.mg4j.io.InputBitStream} and {@link it.unimi.dsi.mg4j.io.OutputBitStream}, which can wrap any standard Java corresponding stream and make it work at the bit level; moreover, they provide support for several useful formats (such as unary, binary, minimal binary, γ, δ and Golomb encoding).

Compression can be achieved using self-delimiting formats supported by the classes above, or also by arithmetic coding, using the classes {@link it.unimi.dsi.mg4j.io.ArithmeticCoder} and {@link it.unimi.dsi.mg4j.io.ArithmeticDecoder}. Note that arithmetic coding is not very efficient in the present implementation, as it does not allow a varying number of symbols.

Bit input and output streams offer also efficient buffering and a way to reposition the bit stream in case the underlying byte stream is a file-based stream or a {@link it.unimi.dsi.fastutil.io.RepositionableStream}.

Conventions

All coding methods work on natural numbers. The encoding of zero is very natural for some techniques, and much less natural for others. To keep methods rationally organised, all methods are able to encode any natural number. If, for instance, you want to write positive numbers in unary encoding and you do not want to waste a bit, you have to decrement them first (i.e., instead of p you must encode p−1).

Java Source File NameTypeComment
ArithmeticCoder.javaClass An arithmetic coder.

This class provides an arithmetic coder.

ArithmeticDecoder.javaClass An arithmetic decoder.

This class provides an arithmetic decoder.

ByteArrayPostingList.javaClass Lightweight posting accumulator with format similar to that generated by BitStreamIndexWriter .

This class is essentially a dirty trick: it borrows some code and precomputed tables from OutputBitStream and exposes two simple methods ( ByteArrayPostingList.setDocumentPointer(int) and ByteArrayPostingList.addPosition(int) ) with obvious semantics.

ByteBufferInputStream.javaClass A bridge between byte and .
DebugInputBitStream.javaClass A debugging wrapper for input bit streams.

This class can be used to wrap an input bit stream.

DebugOutputBitStream.javaClass A debugging wrapper for output bit streams.

This class can be used to wrap an output bit stream.

FastBufferedReader.javaClass A lightweight, unsynchronised buffered reader based on .

This class provides buffering for readers, but it does so with purposes and an internal logic that are radically different from the ones adopted in java.io.BufferedReader .

There is no support for marking.

FastByteArrayInputStream.javaClass Simple, fast and repositionable byte-array input stream.
FastByteArrayOutputStream.javaClass Simple, fast byte-array output stream that exposes the backing array.

java.io.ByteArrayOutputStream is nice, but to get its content you must generate each time a new object.

FastMultiByteArrayInputStream.javaClass Simple, fast and repositionable byte array input stream that multiplexes its content among several arrays. This class is significantly slower than it.unimi.dsi.mg4j.io.FastByteArrayInputStream , but it can hold 256 PiB of data.
FileLinesCollection.javaClass A wrapper exhibiting the lines of a file as a java.util.Collection .

Warning: the lines returned by iterators generated by instances of this class are not cacheable.

InputBitStream.javaClass Bit-level input stream.

Warning: for simplicity, efficiency and lack of usefulness overflowing and unget features have been removed in MG4J 1.1.

InterpolativeCoding.javaClass Static methods implementing interpolative coding.

Interpolative coding is a sophisticated compression technique that can be applied to increasing sequences of integers.

LineIterator.javaClass An adapter that exposes a fast buffered reader as an iterator over the returned lines.
LineWordReader.javaClass A trivial it.unimi.dsi.mg4j.io.WordReader that considers each line of a document a single word.

The intended usage of this class is that of indexing stuff like lists of document identifiers: if the identifiers contain nonalphabetical characters, the default it.unimi.dsi.mg4j.io.FastBufferedReader might do a poor job.

MultipleInputStream.javaClass A multiple input stream.
NullInputStream.javaClass End-of-stream-only input stream.

This stream has length 0, and will always return end-of-file on any read attempt.

This class is a singleton.

NullOutputStream.javaClass Throw-it-away output stream.

This stream discards whatever is written into it.

NullReader.javaClass End-of-stream-only reader.

This reader will always return end-of-file on any read attempt.

This class is a singleton.

OutputBitStream.javaClass Bit-level output stream.

This class wraps any OutputStream so that you can treat it as bit stream.

SafelyCloseable.javaInterface A marker interface for a closeable resource that implements safety measures to make resource tracking easier.

Classes implementing this interface must provide a safety-net finaliser—a finaliser that closes the resource and logs that resource should have been closed.

When the implementing class is abstract, concrete subclasses must call super.close() in their own java.io.Closeable.close method to let the abstract class track correctly the resource.

SegmentedInputStream.javaClass Exhibits a single InputStream as a number of streams divided into java.io.InputStream.reset reset() -separated segments.

An instance of this class wraps a given input stream (usually a replicable one, such as a java.io.FileInputStream ) and exposes its contents as a number of separated input streams.

WordReader.javaInterface An interface providing methods to break the input from a reader into words.

The intended implementations of this interface should decorate a given reader (see, for instance, it.unimi.dsi.mg4j.io.FastBufferedReader ). The reader can be changed at any time using WordReader.setReader(Reader) .

This interface is heavily oriented towards reusability and streaming.

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