Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import java.io.*;
  2.  
  3. public class Methods {
  4.  
  5. public static boolean hatMindestlaenge(InputStream is, long laenge) {
  6. byte[] buffer = new byte[10];
  7. int count = 0;
  8.  
  9. try {
  10. is.read(buffer);
  11. for(byte b:buffer) {
  12. count++;
  13. }
  14. }
  15. catch(Exception e) {
  16. e.printStackTrace();
  17. }
  18. if (count > laenge) {
  19. return true;
  20. }
  21. return false;
  22.  
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement