diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index 8f44560..0000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,49 +0,0 @@
-## Booz Allen Public License v1.0 
-
-
-### INTRODUCTION
-The Booz Allen Public License allows government, non-profit academic, other non-profit, and commercial entities access to distinctive, disruptive, and robust code with the goal of Empowering People to Change the World&#8480;. Products licensed under the Booz Allen Public License are founded on the basis that collective ingenuity can make the largest impact in the community. 
-
-### DEFINITIONS
-* **Commercial Entity.** “Commercial Entity” means any individual or entity other than a government, non-profit academic, or other non-profit entity.
-* **Derivative.** “Derivative” means any work of authorship in Source Code or Object Code form that results from an addition to, deletion from, or modification of the Source Code of the Product.
-* **License.**  “License” means this Booz Allen Public License.
-* **Object Code.** “Object Code” means the form resulting from transformation or translation of Source Code into machine readable code, including but not limited to, compiled object code.
-* **Originator.** “Originator” means each individual or legal entity that creates, contributes to the creation of, or owns the Product. 
-* **Patent Claims.** “Patent Claims” means any patent claim(s) in any patent to which Originator has a right to grant a license that would be infringed by Your making, using, selling, offering for sale, having made, or importing of the Product, but for the grant of this License. 
-* **Product.** “Product” means the Source Code of the software which the initial Originator made available under this License, and any Derivative of such Source Code. 
-* **Source Code.** “Source Code” means software in human-readable form.
-* **You.** “You” means either an individual or an entity (if you are taking this license on behalf of an entity) that exercises the rights granted under this License.  
-  
-### LICENSE
-**Government/Non-Profit Academic/Other Non-Profit.**  
-This Section applies if You are not a Commercial Entity.  
-
-* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License in order to support the general public good and for your internal business purposes.
-* **Distribution.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form.  If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License.  You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice.
-* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton is the Originator, please contact Booz Allen Hamilton at  <opensource@bah.com>.  
-
-**Commercial Entities**.  
-This Section applies if You are a Commercial Entity.
-
-* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License for the sole purpose of Your internal business purposes and the provision of services to government, non-profit academic, and other non-profit entities. 
-* **Distribution and Derivatives.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form.  If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License.  You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice, provided that You make available, and inform the recipient of such distribution how they can obtain, a copy of the Source Code thereof, at no charge, and inform the recipient of the Source Code that the Product is governed under this License and how they can obtain a copy of this License.
-* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton, please contact Booz Allen Hamilton at <opensource@bah.com>.   
-
- 
-**Patent Claim(s)**.  
-This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity. 
-
-* **Patent License.** Subject to the limitations in the Sections above, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license under Patent Claims of such Originator to make, use, sell, offer for sale, have made, and import the Product.  The foregoing patent license does not apply (a) to any code that an Originator has removed from the Product, or (b) for infringement caused by Your modifications of the Product or the combination of any Derivative created by You or on Your behalf with other software.      
-
-### GENERAL TERMS 
-This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity.
-
-* **Required Notices.** If You distribute the Product or a Derivative, in Object Code or Source Code form, You shall not remove or otherwise modify any proprietary markings or notices contained within or placed upon the Product or any Derivative. Any distribution of the Product or a Derivative, in Object Code or Source Code form, shall contain a clear and conspicuous Originator copyright and license reference in accordance with the below:
-	* *Unmodified Product Notice*: “This software package is licensed under the Booz Allen Public License. Copyright © 20__ [Copyright Holder Name].  All Rights Reserved.”
-	* *Derivative Notice*: “This software package is licensed under the Booz Allen Public License. Portions of this code are Copyright © 20__ [Copyright Holder Name].  All Rights Reserved.”
-* **Compliance with Laws.** You agree that You shall not reproduce, display, perform, modify, distribute and otherwise use the Product in any way that violates applicable law or regulation or infringes or violates the rights of others, including, but not limited to, third party intellectual property, privacy, and publicity rights.
-* **Disclaimer.** You understand that the Product is licensed to You, and not sold. The Product is provided on an “As Is” basis, without any warranties, representations, and guarantees, whether oral or written, express, implied or statutory, with regard to the Product, including without limitation, warranties of merchantability, fitness for a particular purpose, title, non-infringement, non-interference, and warranties arising from course of dealing or usage of trade, to the maximum extent permitted by applicable law.  Originator does not warrant that (i) the Product will meet your needs; (ii) the Product will be error-free or accessible at all times; or (iii) the use or the results of the use of the Product will be correct, accurate, timely, or otherwise reliable. You acknowledge that the Product has not been prepared to meet Your individual requirements, whether or not such requirements have been communicated to Originator. You assume all responsibility for use of the Product.
-* **Limitation of Liability.** Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Originator, or anyone who distributes the Product in accordance with this License, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if informed of the possibility of such damages.
-* **Export Control.** The Product is subject to U.S. export control laws and may be subject to export or import regulations in other countries.  You agree to strictly comply with all such laws and regulations and acknowledges that You are responsible for obtaining such licenses to export, re-export, or import as may be required.
-* **Severability.** If the application of any provision of this License to any particular facts or circumstances shall be held to be invalid or unenforceable, then the validity and enforceability of other provisions of this License shall not in any way be affected or impaired thereby.  
diff --git a/README.md b/README.md
index ded31f1..9a15a9c 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
 <div align="center">
 
 **Modzy's Java SDK queries models, submits inference jobs, and returns results directly to your editor.**
-
+    
 
 ![GitHub contributors](https://img.shields.io/github/contributors/modzy/sdk-java)
 ![GitHub last commit](https://img.shields.io/github/last-commit/modzy/sdk-java)
diff --git a/src/main/java/com/modzy/sdk/JobClient.java b/src/main/java/com/modzy/sdk/JobClient.java
index c477386..b1c76e1 100644
--- a/src/main/java/com/modzy/sdk/JobClient.java
+++ b/src/main/java/com/modzy/sdk/JobClient.java
@@ -1,5 +1,8 @@
 package com.modzy.sdk;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +30,7 @@
 import com.modzy.sdk.model.JobStatus;
 import com.modzy.sdk.model.Model;
 import com.modzy.sdk.model.ModelVersion;
+import com.modzy.sdk.util.DataSize;
 import org.glassfish.jersey.media.multipart.MultiPart;
 import com.modzy.sdk.util.LoggerFactory;
 import org.glassfish.jersey.media.multipart.MultiPartFeature;
@@ -137,12 +141,21 @@ public Job submitJob(Job job) throws ApiException{
 	private Job submitOpenJob(Job job) throws ApiException{
 		//Open the job
 		Job openJob = this.submitJob(new Job(job.getModel()));
+		//
+		int chunkSize = 1024*1024;
+		try{
+			Map<String,String> features = this.getFeatures();
+			DataSize dataSize = new DataSize(features.get("inputChunkMaximumSize"));
+			chunkSize = dataSize.getBytes().intValue();
+		} catch(ApiException ae){
+			this.logger.log(Level.WARNING, "Unexpected exception parsing the features, asuming defaults", ae);
+		}
 		//Iterate and submit the inputs
 		try {
 			JobInput<InputStream> jobInput = (JobInput<InputStream>) job.getInput();
 			for (Map.Entry<String, Map<String, InputStream>> inputItem : jobInput.getSources().entrySet()) {
 				for (Map.Entry<String, InputStream> dataItem : inputItem.getValue().entrySet()) {
-					appendInput(openJob, inputItem.getKey(), dataItem.getKey(), dataItem.getValue());
+					appendInput(openJob, inputItem.getKey(), dataItem.getKey(), dataItem.getValue(), chunkSize);
 				}
 			}
 		} catch( ApiException ae ){
@@ -150,7 +163,7 @@ private Job submitOpenJob(Job job) throws ApiException{
 			try{
 				this.cancelJob(openJob);
 			} catch( ApiException e2 ){
-				this.logger.log(Level.WARNING, "Unpexpected exception trying to cancel the job", e2);
+				this.logger.log(Level.WARNING, "Unexpected exception trying to cancel the job", e2);
 			}
 			throw ae;
 		}
@@ -158,19 +171,26 @@ private Job submitOpenJob(Job job) throws ApiException{
 		return this.closeJob(openJob);
 	}
 
-	private void appendInput(Job job, String inputItemKey, String dataItemKey, InputStream value) throws ApiException{
+	private void appendInput(Job job, String inputItemKey, String dataItemKey, InputStream inputValue, int chunkSize) throws ApiException{
 		Builder builder = this.restTarget
 				.register(MultiPartFeature.class)
 				.path(job.getJobIdentifier()).path(inputItemKey).path(dataItemKey)
 				.request(MediaType.MULTIPART_FORM_DATA);
 		builder.header("Authorization", "ApiKey "+this.apiKey);
-		MultiPart data = new MultiPart();
-		data.bodyPart( new StreamDataBodyPart("input", value, dataItemKey) );
+		BufferedInputStream bis;
+		MultiPart data;
+		byte inputBuffer[] = new byte[chunkSize];
+		int chunkByteCount;
 		try {
-			logger.info("Adding input: "+job.getJobIdentifier()+" "+inputItemKey+" "+dataItemKey);
-			Response response = builder.post(Entity.entity(data, data.getMediaType()));
-			if( response.getStatus() >= 400 ){
-				throw new ApiException("The server respond with a status "+response.getStatus());
+			bis = new BufferedInputStream(inputValue, chunkSize);
+			while( (chunkByteCount = bis.read(inputBuffer)) != -1 ){
+				logger.info("Adding input: "+job.getJobIdentifier()+" "+inputItemKey+" "+dataItemKey+" ["+chunkByteCount+"]");
+				data = new MultiPart();
+				data.bodyPart( new StreamDataBodyPart("input", new ByteArrayInputStream(inputBuffer, 0, chunkByteCount), dataItemKey) );
+				Response response = builder.post(Entity.entity(data, data.getMediaType()));
+				if( response.getStatus() >= 400 ){
+					throw new ApiException("The server respond with a status "+response.getStatus());
+				}
 			}
 		}  catch(ResponseProcessingException rpe) {
 			this.logger.log(Level.SEVERE, rpe.getMessage(), rpe);
@@ -178,6 +198,9 @@ private void appendInput(Job job, String inputItemKey, String dataItemKey, Input
 		} catch(ProcessingException pr) {
 			this.logger.log(Level.SEVERE, pr.getMessage(), pr);
 			throw new ApiException(pr);
+		} catch (IOException ioe) {
+			this.logger.log(Level.SEVERE, ioe.getMessage(), ioe);
+			throw new ApiException("Error reading the input provided ["+inputItemKey+"/"+dataItemKey+"]", ioe);
 		}
 	}
 
@@ -313,6 +336,26 @@ public Job cancelJob(Job job) throws ApiException{
 		this.logger.info("canceling job "+job);
 		return this.cancelJob(job.getJobIdentifier());
 	}		
-	
+
+
+	public Map<String,String> getFeatures() throws ApiException{
+		Builder builder = this.restTarget.path("features").request(MediaType.APPLICATION_JSON);
+		builder.header("Authorization", "ApiKey "+this.apiKey);
+		try {
+			return builder.get(Map.class);
+		}
+		catch(ResponseProcessingException rpe) {
+			this.logger.log(Level.SEVERE, rpe.getMessage(), rpe);
+			throw new ApiException(rpe);
+		}
+		catch(ProcessingException pr) {
+			this.logger.log(Level.SEVERE, pr.getMessage(), pr);
+			throw new ApiException(pr);
+		}
+		catch(WebApplicationException wae) {
+			this.logger.log(Level.SEVERE, wae.getMessage(), wae);
+			throw new ApiException(wae);
+		}
+	}
 	
 }
diff --git a/src/main/java/com/modzy/sdk/util/DataSize.java b/src/main/java/com/modzy/sdk/util/DataSize.java
new file mode 100644
index 0000000..cfc5cc4
--- /dev/null
+++ b/src/main/java/com/modzy/sdk/util/DataSize.java
@@ -0,0 +1,177 @@
+package com.modzy.sdk.util;
+
+import java.text.DecimalFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Helper class to convert size units that comes as string on the yaml file.
+ *
+ * @see <a href="https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/util/unit/DataSize.java">Spring implementation</a>
+ */
+public class DataSize {
+
+    /**
+     * The pattern for parsing.
+     */
+    private static final Pattern PATTERN = Pattern.compile("^(\\d+(\\.\\d+)?)([a-zA-Z]{0,2})$");
+
+    private Long bytes;
+
+    private String strSize;
+
+    public DataSize(Long bytesSize){
+        this.setBytes(bytesSize);
+    }
+
+    public DataSize(String stringSize){
+        this.setBytes(stringSize);
+    }
+
+    public DataSize(Object objectSize){
+        this.setBytes(objectSize);
+    }
+
+    public void setBytes(Long bytesSize){
+        this.bytes = bytesSize;
+    }
+
+    public void setBytes(Number bytesSize){
+        this.bytes = bytesSize.longValue();
+    }
+
+    public void setBytes(String stringSize){
+        Matcher matcher = DataSize.PATTERN.matcher(stringSize);
+        if( matcher.matches() ){
+            DataUnit dataUnit = DataUnit.findValueOf(matcher.group(3));
+            this.bytes = (long)((double)dataUnit.size()*Double.parseDouble(matcher.group(1)));
+            this.strSize = stringSize;
+        }
+    }
+
+    public void setBytes(Object objectSize){
+        if( objectSize instanceof Number ){
+            this.setBytes((Number)objectSize);
+        }
+        else{
+            this.setBytes(String.valueOf(objectSize));
+        }
+    }
+
+    public Long getBytes(){
+        return this.bytes;
+    }
+
+    @Override
+    public String toString(){
+        if(this.strSize != null){
+            return this.strSize;
+        }
+        Double   size = null;
+        DataUnit unit = null;
+        if( this.bytes != null ) {
+            for (DataUnit dataUnit : DataUnit.values()) {
+                long div = this.bytes / dataUnit.size();
+                if (div > 0) {
+                    double div2 = (double)this.bytes / (double)dataUnit.size();
+                    if (size == null || div2 < size) {
+                        size = div2;
+                        unit = dataUnit;
+                    }
+                }
+            }
+        }
+        DecimalFormat decimalFormat = new DecimalFormat("#.##");
+        return decimalFormat.format(size)+unit.suffix();
+    }
+
+}
+
+enum DataUnit{
+
+    /**
+     * Bytes, represented by suffix {@code i}.
+     */
+    BYTES("i", 1l),
+
+    /**
+     * Kilobytes, represented by suffix {@code K}.
+     */
+    KILOBYTES("K", 1000l),
+
+    /**
+     * Megabytes, represented by suffix {@code M}.
+     */
+    MEGABYTES("M", 1000l*1000l),
+
+    /**
+     * Gigabytes, represented by suffix {@code G}.
+     */
+    GIGABYTES("G", 1000l*1000l*1000l),
+
+    /**
+     * Terabytes, represented by suffix {@code T}.
+     */
+    TERABYTES("T", 1000l*1000l*1000l*1000l),
+
+    /**
+     * Kibibytes, represented by suffix {@code Ki}.
+     */
+    KIBIBYTES("Ki", 1024l),
+
+    /**
+     * Mebibytes, represented by suffix {@code Mi}.
+     */
+    MEBIBYTES("Mi", 1024l*1024l),
+
+    /**
+     * Gibibytes, represented by suffix {@code Gi}.
+     */
+    GIBIBYTES("Gi", 1024l*1024l*1024l),
+
+    /**
+     * Tebibytes, represented by suffix {@code Ti}.
+     */
+    TEBIBYTES("Ti", 1024l*1024l*1024l*1024l),
+
+    /**
+     * Kibibytes (non decimal Kilobytes), represented by suffix {@code KB}.
+     */
+    KIBIBYTES_LEGACY("KB", 1024l),
+
+    /**
+     * Mebibytes (non decimal Megabytes), represented by suffix {@code MB}.
+     */
+    MEBIBYTES_LEGACY("MB", 1024l*1024l),
+
+    /**
+     * Gibibytes (non decimal Gigabytes), represented by suffix {@code GB}.
+     */
+    GIBIBYTES_LEGACY("GB", 1024l*1024l*1024l),
+
+    /**
+     * Tebibytes (non decimal Terabytes), represented by suffix {@code TB}.
+     */
+    TEBIBYTES_LEGACY("TB", 1024l*1024l*1024l*1024l);
+
+    private final String suffix;
+    private final long size;
+
+    DataUnit(String suffix, long size){
+        this.suffix = suffix;
+        this.size = size;
+    }
+
+    String suffix(){return this.suffix;};
+
+    long size(){return this.size;}
+
+    public static DataUnit findValueOf(String suffix){
+        for(DataUnit dataUnit : DataUnit.values() ){
+            if( dataUnit.suffix().compareToIgnoreCase(suffix) == 0 ){
+                return dataUnit;
+            }
+        }
+        return null;
+    }
+}
