package peergos.shared.user.fs;

/** A Fragment is a part of an EncryptedChunk which is stored directly in IPFS in raw format
 *
 */
public class Fragment {
    public static final int MAX_LENGTH = 1024*128;

    public final byte[] data;

    public Fragment(byte[] data) {
        if (MAX_LENGTH < data.length)
            throw new IllegalStateException("fragment size "+ data.length +" greater than max "+ MAX_LENGTH);
        this.data = data;
    }
}

@@ -108,16 +108,18 @@
 IPFS in 
+a 
 raw form
@@ -120,16 +120,22 @@
 w format
+ block
 %0A *%0A */%0A
@@ -203,17 +203,66 @@
 H = 
-1024*128;
+512*1024; // max size allowed by bitswap protocol is 1 MiB
 %0A%0A  

Increase max fragment size from 128 KiB to 512 KiB.