// Path: src/main/java/org/struckture/base/exceptions/StrucktureReadException.java
// public class StrucktureReadException extends StruckException {
// 
//     /**
//      * Constructor.
//      * @param message message
//      */
//     public StrucktureReadException(String message) {
//         super(message);
//     }
// 
//     /**
//      * Constructor.
//      * @param message message
//      * @param cause cause
//      */
//     public StrucktureReadException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import org.struckture.base.annotations.StruckField;
import org.struckture.base.annotations.Struckture;
import org.struckture.base.exceptions.StrucktureReadException;
import org.junit.Test;
import java.io.InputStream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
package org.struckture.base;




/**
 * Test.
 */
public class StruckReadTest extends StrucktureTest {

    @Struckture(length = 0x10)
    private static class StruckTestStructure {
        @StruckField(offset = 7)
        private byte[] array;

        @StruckField(offset = 0)
        private Integer size;

        @StruckField(offset = 7)
        private int test2;
    }

    @Test
    public void shouldReadMoreStructuresFromStream() {
        //given
        InputStream stream = stream(
                o(0x7, 0, 0, 0x10, 0, 0, 0, 0), o(0x7, 0, 0, 0x5, 0, 0, 0, 0),
                o(0x20, 0, 0, 0x10, 0, 0, 0, 0), o(0x7, 0, 0, 0x5, 0, 0, 0, 0));
        Struck<StruckTestStructure> struck = Strucktor.forClass(StruckTestStructure.class);

        //when
        struck.read(stream);
        struck.read(stream);

        //then
        //Yuppie no exception
    }


// Path: src/main/java/org/struckture/base/exceptions/StrucktureReadException.java
// public class StrucktureReadException extends StruckException {
// 
//     /**
//      * Constructor.
//      * @param message message
//      */
//     public StrucktureReadException(String message) {
//         super(message);
//     }
// 
//     /**
//      * Constructor.
//      * @param message message
//      * @param cause cause
//      */
//     public StrucktureReadException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: src/test/java/org/struckture/base/StruckReadTest.java
import org.struckture.base.annotations.StruckField;
import org.struckture.base.annotations.Struckture;
import org.struckture.base.exceptions.StrucktureReadException;
import org.junit.Test;
import java.io.InputStream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

package org.struckture.base;




/**
 * Test.
 */
public class StruckReadTest extends StrucktureTest {

    @Struckture(length = 0x10)
    private static class StruckTestStructure {
        @StruckField(offset = 7)
        private byte[] array;

        @StruckField(offset = 0)
        private Integer size;

        @StruckField(offset = 7)
        private int test2;
    }

    @Test
    public void shouldReadMoreStructuresFromStream() {
        //given
        InputStream stream = stream(
                o(0x7, 0, 0, 0x10, 0, 0, 0, 0), o(0x7, 0, 0, 0x5, 0, 0, 0, 0),
                o(0x20, 0, 0, 0x10, 0, 0, 0, 0), o(0x7, 0, 0, 0x5, 0, 0, 0, 0));
        Struck<StruckTestStructure> struck = Strucktor.forClass(StruckTestStructure.class);

        //when
        struck.read(stream);
        struck.read(stream);

        //then
        //Yuppie no exception
    }


    @Test(expected = StrucktureReadException.class)