@@ -130,48 +130,34 @@ public Inode(byte[] bytes) {
130
130
}
131
131
}
132
132
133
- public int getVersion () {
134
- return version ;
135
- }
136
-
137
- public int getMagic () {
133
+ @ Deprecated (forRemoval = true )
134
+ protected int getMagic () {
138
135
return magic ;
139
136
}
140
137
141
- public int getGeneration () {
138
+ @ Deprecated (forRemoval = true )
139
+ protected int getGeneration () {
142
140
return generation ;
143
141
}
144
142
145
- public int getExportIdx () {
143
+ @ Deprecated (forRemoval = true )
144
+ protected int getExportIdx () {
146
145
return exportIdx ;
147
146
}
148
147
149
- public int getType () {
148
+ @ Deprecated (forRemoval = true )
149
+ protected int getType () {
150
150
return type ;
151
151
}
152
152
153
- public byte [] getFsOpaque () {
153
+ @ Deprecated (forRemoval = true )
154
+ protected byte [] getFsOpaque () {
154
155
return fs_opaque ;
155
156
}
156
157
157
- public byte [] bytes () {
158
- int len = fs_opaque .length + MIN_LEN ;
159
- byte [] bytes = new byte [len ];
160
- ByteBuffer b = ByteBuffer .wrap (bytes );
161
- b .order (ByteOrder .BIG_ENDIAN );
162
-
163
- b .putInt (version << 24 | magic );
164
- b .putInt (generation );
165
- b .putInt (exportIdx );
166
- b .put ((byte ) type );
167
- b .put ((byte ) fs_opaque .length );
168
- b .put (fs_opaque );
169
- return bytes ;
170
- }
171
-
172
158
@ Override
173
159
public String toString () {
174
- return BaseEncoding .base16 ().lowerCase ().encode (this .bytes ());
160
+ return BaseEncoding .base16 ().lowerCase ().encode (this .toNfsHandle ());
175
161
}
176
162
177
163
private static boolean arrayEquals (byte [] a1 , byte [] a2 , int len ) {
@@ -198,12 +184,23 @@ public byte[] getFileId() {
198
184
}
199
185
200
186
public byte [] toNfsHandle () {
201
- return bytes ();
202
- }
187
+ int len = fs_opaque .length + MIN_LEN ;
188
+ byte [] bytes = new byte [len ];
189
+ ByteBuffer b = ByteBuffer .wrap (bytes );
190
+ b .order (ByteOrder .BIG_ENDIAN );
191
+
192
+ b .putInt (version << 24 | magic );
193
+ b .putInt (generation );
194
+ b .putInt (exportIdx );
195
+ b .put ((byte ) type );
196
+ b .put ((byte ) fs_opaque .length );
197
+ b .put (fs_opaque );
198
+ return bytes ;
199
+ }
203
200
204
201
@ Override
205
202
public int hashCode () {
206
- return Arrays .hashCode (bytes ());
203
+ return Arrays .hashCode (toNfsHandle ());
207
204
}
208
205
209
206
@ Override
@@ -215,7 +212,7 @@ public boolean equals(Object obj) {
215
212
return false ;
216
213
}
217
214
final Inode other = (Inode ) obj ;
218
- return Arrays .equals (bytes (), other .bytes ());
215
+ return Arrays .equals (toNfsHandle (), other .toNfsHandle ());
219
216
}
220
217
221
218
public boolean isPseudoInode () {
@@ -226,7 +223,8 @@ public int exportIndex() {
226
223
return getExportIdx ();
227
224
}
228
225
226
+ @ Deprecated
229
227
public int handleVersion () {
230
- return getVersion () ;
228
+ return version ;
231
229
}
232
230
}
0 commit comments