Skip to content

Commit 45c5183

Browse files
authored
Merge pull request #12 from saalfeldlab/development
alpha-4 prerelease to align with N5-alpha-4
2 parents 1fbf9f1 + e70099e commit 45c5183

File tree

4 files changed

+343
-63
lines changed

4 files changed

+343
-63
lines changed

pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.scijava</groupId>
77
<artifactId>pom-scijava</artifactId>
8-
<version>40.0.0</version>
8+
<version>43.0.0</version>
99
<relativePath />
1010
</parent>
1111

@@ -86,7 +86,14 @@
8686
<!-- NB: Deploy releases to the SciJava Maven repository. -->
8787
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
8888

89-
<n5.version>4.0.0-alpha-1</n5.version>
89+
<!-- TODO remove when pom-scijava-base is updated -->
90+
<scijava.jvm.version>8</scijava.jvm.version>
91+
<scijava.jvm.build.version>[1.8.0-101,)</scijava.jvm.build.version>
92+
93+
<!-- <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>-->
94+
<jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
95+
96+
<n5.version>4.0.0-alpha-4</n5.version>
9097
</properties>
9198

9299
<dependencies>

src/main/java/org/janelia/saalfeldlab/n5/blosc/BloscCompression.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
*/
5454
package org.janelia.saalfeldlab.n5.blosc;
5555

56-
import java.io.IOException;
5756
import java.nio.ByteBuffer;
5857
import org.blosc.BufferSizes;
5958
import org.blosc.JBlosc;
@@ -86,54 +85,56 @@ public class BloscCompression implements Compression {
8685
@CompressionParameter
8786
private final int blocksize;
8887

88+
@CompressionParameter
89+
private final int typesize;
90+
8991
@CompressionParameter
9092
private int nthreads;
9193

9294
private static final transient JBlosc blosc = new JBlosc();
9395

94-
9596
public String getCname() {
9697

9798
return cname;
9899
}
99100

100-
101101
public int getClevel() {
102102

103103
return clevel;
104104
}
105105

106-
107106
public int getShuffle() {
108107

109108
return shuffle;
110109
}
111110

112-
113111
public int getBlocksize() {
114112

115113
return blocksize;
116114
}
117115

116+
public int getTypesize() {
117+
118+
return typesize;
119+
}
118120

119121
public int getNthreads() {
120122

121123
return nthreads;
122124
}
123125

124-
125126
public void setNthreads(final int nthreads) {
126127

127128
this.nthreads = nthreads;
128129
}
129130

130-
131131
public BloscCompression() {
132132

133133
this.cname = "blosclz";
134134
this.clevel = 6;
135135
this.shuffle = NOSHUFFLE;
136136
this.blocksize = 0; // auto
137+
this.typesize = 1;
137138
this.nthreads = 1;
138139
}
139140

@@ -142,21 +143,34 @@ public BloscCompression(
142143
final int clevel,
143144
final int shuffle,
144145
final int blocksize,
146+
final int typesize,
145147
final int nthreads) {
146148

147149
this.cname = cname;
148150
this.clevel = clevel;
149151
this.shuffle = shuffle;
150152
this.blocksize = blocksize;
153+
this.typesize = typesize;
151154
this.nthreads = nthreads;
152155
}
153156

157+
public BloscCompression(
158+
final String cname,
159+
final int clevel,
160+
final int shuffle,
161+
final int blocksize,
162+
final int nthreads) {
163+
164+
this(cname, clevel, shuffle, blocksize, 1, nthreads);
165+
}
166+
154167
public BloscCompression(final BloscCompression template) {
155168

156169
this.cname = template.cname;
157170
this.clevel = template.clevel;
158171
this.shuffle = template.shuffle;
159172
this.blocksize = template.blocksize;
173+
this.typesize = template.typesize;
160174
this.nthreads = template.nthreads;
161175
}
162176

@@ -175,12 +189,12 @@ private byte[] decode(final byte[] data, final byte[] dstBuffer) {
175189
}
176190

177191
@Override
178-
public ReadData decode(final ReadData readData) throws IOException {
192+
public ReadData decode(final ReadData readData) {
179193
return ReadData.from(decode(readData.allBytes(), null));
180194
}
181195

182196
@Override
183-
public ReadData encode(final ReadData readData) throws IOException {
197+
public ReadData encode(final ReadData readData) {
184198
final byte[] serialized = readData.allBytes();
185199
final ByteBuffer src = ByteBuffer.wrap(serialized);
186200
final ByteBuffer dst = ByteBuffer.allocate(serialized.length + JBlosc.OVERHEAD);

0 commit comments

Comments
 (0)